duckdb/duckdb-postgres

support passing a custom port

Closed this issue · 2 comments

dbist commented

What happens?

it'd be great to pass a custom port to the extension, i.e. CALL postgres_attach('dbname=defaultdb user=root host=127.0.0.1', port=26257, source_schema='public');

Today, I get the following

Error: Binder Error: Invalid named parameter "port" for function postgres_attach
Candidates:     suffix VARCHAR
    sink_schema VARCHAR
    source_schema VARCHAR
    filter_pushdown BOOLEAN
    overwrite BOOLEAN

To Reproduce

simply add port=portnum to the attach command

OS:

OSX 13.2

PostgreSQL Version:

13.0

DuckDB Version:

7

DuckDB Client:

CLI

Full Name:

Artem Ervits

Affiliation:

e.g. Cockroach Labs

Have you tried this on the latest master 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

I believe the port can be part of the connection string:

CALL postgres_attach('dbname=defaultdb user=root host=127.0.0.1 port=26257', source_schema='public');
dbist commented

yes thank you @Mytherin, I confirmed and it works when you place the port inside the single quotes as you indicated. My mistake for not seeing the quotes.