Can't copy between 2 Postgres databases using COPY FROM DATABASE
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- postgresql
- Domain
- databases
Research direction
Start by reproducing COPY FROM DATABASE between PostgreSQL 14 and 15 through the DuckDB CLI, including the SCHEMA option. Trace why the operation generates CREATE INDEX orders_pkey ON public.orders() for the shown table. Done means schema and data copying no longer produce an empty index column list.
Written by the indexing model from the issue text.
Description
What happens?
I have attached 2 Postgres databases (PG14 and PG15) and able to run queries on both databases. PG15 database is empty and does not have any tables. When I run the following statement, I get an error:
COPY FROM DATABASE pg14 TO pg15;
Invalid Error: Failed to execute query "CREATE INDEX orders_pkey ON public.orders()": ERROR: syntax error at or near ")"
LINE 1: CREATE INDEX orders_pkey ON public.orders()
^
D show orders;
┌──────────────┬───────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │ null │ key │ default │ extra │
│ varchar │ varchar │ varchar │ varchar │ varchar │ varchar │
├──────────────┼───────────────┼─────────┼─────────┼─────────┼─────────┤
│ order_id │ INTEGER │ NO │ PRI │ │ │
│ customer_id │ INTEGER │ YES │ │ │ │
│ order_date │ DATE │ YES │ │ │ │
│ product_id │ INTEGER │ YES │ │ │ │
│ notes │ VARCHAR │ YES │ │ │ │
│ total_amount │ DECIMAL(10,2) │ YES │ │ │ │
└──────────────┴───────────────┴─────────┴─────────┴─────────┴─────────┘
I tried to copy the schema only using the query below and got the same error:
COPY FROM DATABASE pg14 TO pg15 (SCHEMA);
To Reproduce
Create the same table with the same table structure and try copying between 2 postgres hosts.
OS:
macOS
PostgreSQL Version:
14 and 15
DuckDB Version:
1.1.0
DuckDB Client:
CLI
Full Name:
Arash Nikoo
Affiliation:
Akamai
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
- Dominant language
- C++
- Stars
- 375
- Forks
- 113
- Avg merge
- 5h 32m
- Merged PRs (30d)
- 36
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from duckdb/duckdb-postgres
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
duckdb/duckdb-postgres#638 ·
Maintainers usually reply within 1 day
-
v2.0: generate_subscripts(list, 1) fails with 'positional argument following named argument' after attaching PostgresPossibly taken @staticlibs claimed this 2 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
duckdb/duckdb-postgres#630 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
duckdb/duckdb-postgres#628 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
duckdb/duckdb-postgres#623 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
duckdb/duckdb-postgres#618 ·
Maintainers usually reply within 1 day
All issues in duckdb/duckdb-postgres
Similar issues
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusPossibly taken @leizhiyuan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/rocketmq-clients#1465 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
bug IO
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainers usually reply within 1 day
-
pnnx: manual tanh GELU fusion loses the approximation modePossibly taken @ktz03 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Tencent/ncnn#7175 · 1 reaction ·
Maintainers usually reply within 1 day