duckdb/postgres_scanner

Binder Error: table "postgres_scan" has duplicate column name

frafra opened this issue · 4 comments

What happens?

I am trying to use postgres_scan over a heterogeneous database, but I get the following error: Binder Error: table "postgres_scan" has duplicate column name "ID".

I have no idea about what that means, because there are no duplicate columns in Postgres in the same table, but the column ID is used across 23 tables. Some schemas have multiple ID columns across different tables:

gisdata=# select table_schema, count(*) from information_schema.columns where column_name = 'ID' group by table_schema having count(*) > 1;
   table_schema   | count 
------------------+-------
 Hydrography      |     2
 merlin_radar     |     6
 openness_tree_db |     2
 public           |     3
 Topography       |     2
(5 rows)

I will be happy to share more information about the database, but the database is not available on the internet, and sharing a huge database dump seems quite useless.

To Reproduce

install postgres;
load postgres;
call postgres_attach('');
Binder Error: table "postgres_scan" has duplicate column name "ID"

OS:

Ubuntu 20.04 x64

PostgreSQL Version:

13.9

DuckDB Version:

0.7.0

DuckDB Client:

Native

Full Name:

Francesco Frassinelli

Affiliation:

Norwegian Institute for Nature Research

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

Can you please share the schema?

I found the problematic schema. I dumped it to a file, loaded into a new Postgres database, and I was able to reproduce the issue.

https://gist.github.com/frafra/2ebf3e82a38e35fd04618123b0875976

Is there any update on this issue; I have the same issue
Error: Binder Error: table "postgres_scan" has duplicate column name "isDirect"

Thanks for the report! This should be fixed now in #111.