Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COPY DATABASE fails on v1.0.0 and segfaults on v1.1.0 #260

Open
2 tasks done
jgrg opened this issue Sep 11, 2024 · 6 comments
Open
2 tasks done

COPY DATABASE fails on v1.0.0 and segfaults on v1.1.0 #260

jgrg opened this issue Sep 11, 2024 · 6 comments

Comments

@jgrg
Copy link

jgrg commented Sep 11, 2024

What happens?

I can connect to and copy tables from a PostgreSQL (running in Docker on my laptop), but if I try to copy the database I get a segmentation fault on v1.1.0, leaving behind a .wal file.
On v1.0.0 I get Not implemented Error: Entry type Index not supported in PhysicalCopyDatabase.
I don't imagine the steps I've shown to reproduce it will be much help. Let me know what I can do to help you narrow it down.

To Reproduce

$ duckdb pg_local.duckdb
v1.1.0 fa5c2fe15f
Enter ".help" for usage hints.
D ATTACH 'postgresql://[email protected]:5435/tqc' AS tqc (TYPE POSTGRES);
D COPY FROM DATABASE tqc TO pg_local;
zsh: segmentation fault  duckdb pg_local.duckdb
$ duckdb-1.0 pg_local.duckdb
v1.0.0 1f98600c2c
Enter ".help" for usage hints.
D ATTACH 'postgresql://[email protected]:5435/tqc' AS tqc (TYPE POSTGRES);
D COPY FROM DATABASE tqc TO pg_local;
Not implemented Error: Entry type Index not supported in PhysicalCopyDatabase

OS:

MacOS

PostgreSQL Version:

12.19

DuckDB Version:

1.1.0

DuckDB Client:

duckdb

Full Name:

James Gilbert

Affiliation:

Wellcome Sanger Institute

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
@Mytherin
Copy link
Contributor

Thanks for the report! I've looked into this and I could reproduce an issue when exporting a database that has many tables (>100s). I've pushed a fix for this in duckdb/duckdb#13889. Could you confirm if your database has a lot of tables, and perhaps retry with the latest nightly build?

@jgrg
Copy link
Author

jgrg commented Sep 13, 2024

Thanks. I tried downloading the nightly build from your installation page, but it gives me a link:

https://github.com/duckdb/duckdb/actions/runs/10587966032/artifacts/1863098716

which yields an archive with a DuckDB binary dated 28th August which says it is v1.0.1-dev4917 45787e5f9f

@jgrg
Copy link
Author

jgrg commented Sep 13, 2024

My database has 62 tables.

@jgrg
Copy link
Author

jgrg commented Sep 13, 2024

One thing weird about the database is that most of the tables are empty.

@Mytherin
Copy link
Contributor

Perhaps you can use the Python client? This should give you yesterdays' nightly build:

python3 -m pip install duckdb --pre --upgrade

If it still reproduces with the latest nightly - could you perhaps try to remove a few of the tables and seeing if the problem persists? You could also pass a SCHEMA argument to attach in order to only copy a single schema, to see if that can narrow down the issue.

@jgrg
Copy link
Author

jgrg commented Sep 13, 2024

Tried using pip --pre which installed 1.1.1.dev100 and the database copy succeeds.
(I hadn't noticed the ability to specify a source schema. I can't specify a destination schema or rename the schema after the copy though, can I?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants