Skip to content

Attaching DB with sslmode argument #384

@valmunos

Description

@valmunos

What happens?

DuckDB version: 1.4.2 (python)

I tried attaching a postgres database using the following command:

duckdb.execute(f"""
    ATTACH 'dbname=postgres host={host} user=postgres password={password} sslmode=allow'
    AS pgdb (TYPE POSTGRES);
""")

The same arguments work just fine when I use the psycopg library, but I'm getting the following error message:

---------------------------------------------------------------------------
IOException                               Traceback (most recent call last)
Cell In[11], line 1
----> 1 duckdb.execute(f"""
      2     ATTACH 'dbname=postgres host=<host> user=postgres password=<password> sslmode=allow'
      3     AS pgdb (TYPE POSTGRES);
      4 """)

IOException: IO Error: Unable to connect to Postgres at "dbname=postgres host=<host> user=postgres password=<password> sslmode=allow": connection to server at "<host>", port 5432 failed: FATAL:  pg_hba.conf rejects connection for host "<host>", user "postgres", database "postgres", no encryption
connection to server at "<host>", port 5432 failed: FATAL:  password authentication failed for user "postgres"

NOTE: I removed all sensitive data from the traceback

To Reproduce

See above.

OS:

Windows

PostgreSQL Version:

16.10

DuckDB Version:

1.4.2

DuckDB Client:

Python

Full Name:

Vincent Munos

Affiliation:

PolicyBind

Have you tried this on the latest main branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions