postgres_scanner icon indicating copy to clipboard operation
postgres_scanner copied to clipboard

Error copying postgres DB to duckdb using build 0.9.3.dev2938 when using the new ATTACH functionality

Open taupirho opened this issue 1 year ago • 1 comments

What happens?

According to the documentation database copying should be available when using dev version of DuckDB but I get the following error when trying to copy a postgres database to a duckdb database. I know its a dev release but thought you guys might be interested

CatalogException: Catalog Error: Schema with name pg_toast does not exist!

To Reproduce

Installed Postgres v16 on my local system and created a database with one table. Next ran the following code fragment after pip installing 0.9.3.dev2938 of duckdb

import duckdb as db

db.sql("ATTACH 'dbname=postgres user=my_db_user password=my_db_pass host=127.0.0.1' AS db_postgres (TYPE postgres)")

attach a DuckDB file

db.sql("ATTACH 'database.db' AS ddb")

export all tables and views from the Postgres database to the DuckDB file

db.sql("COPY FROM DATABASE db_postgres TO ddb")

OS:

Windows 11

DuckDB Version:

0.9.3.dev2938

DuckDB Client:

3.11

Full Name:

Tom Reid

Affiliation:

None

Have you tried this on the latest nightly build?

I have tested with a nightly build

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

  • [X] Yes, I have

taupirho avatar Feb 04 '24 17:02 taupirho

Hello, thanks for raising this issue. I transferred it to the postgres_scanner repository.

szarnyasg avatar Feb 04 '24 17:02 szarnyasg