Connecting with `CALL postgres_attach` loads tables, but displays error
Closed this issue · 1 comments
MarkusSagen commented
What happens?
I have tested the DuckDB with the CLI and in Python.
The preferred method to connect to the postgres database connects throws an exception, but still shows the tables. Not sure if it is a bug or something wrong from my end
Using libpq connection string
I can access the tables, but it displays an error when attempting to attach to the database session
To Reproduce
Attaching in postgres and python works but displays an error
INSTALL postgres; LOAD postgres;
CALL postgres_attach('dbname=idau user=idau host=127.0.0.1');Error: Invalid Error: IO Error: Unsupported Postgres type oid
Or
CALL postgres_attach('postgresql://idau@localhost:5432/idau');Error: Invalid Error: IO Error: Unsupported Postgres type oid
Same issue for python
import duckdb
db = duckdb.connect()
db.execute('''
INSTALL postgres;
LOAD postgres;
CALL postgres_attach('host=127.0.0.1 dbname=idau user=idau port=5432');
''')Fails with: Error: Invalid Error: IO Error: Unsupported Postgres type oid
Shows no errors and works
import duckdb
conn = duckdb.connect()
conn.execute("SELECT * FROM postgres_scan('postgresql://idau@localhost:5432/idau', 'public', '<some_table>')").fetchall()OS:
MacOS 12.6
PostgreSQL Version:
14.6
DuckDB Version:
v0.6.1 919cad22e8 (CLI) and v0.6.2.dev1675 (Python)
DuckDB Client:
CLI and Python
Full Name:
Markus Sagen
Affiliation:
ZagenDuo
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
hannes commented
I've added support for the oid type in the next release