Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#178 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, python
Domain
databases

Research direction

Start by running the provided Python reproduction with PostgreSQL 16 and DuckDB 0.9.3.dev2938, then trace the ATTACH and COPY FROM DATABASE path for PostgreSQL schemas. Confirm the behavior against a current build and identify why pg_toast is queried as a missing schema. Done means copying the database completes without the CatalogException and preserves the source tables and views.

Written by the indexing model from the issue text.

Description

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?
  • Yes, I have
Dominant language
C++
Stars
373
Forks
112
Avg merge
9h 48m
Merged PRs (30d)
28

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-postgres

All issues in duckdb/duckdb-postgres

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.