duckdb/duckdb-postgres

postgres_scan error with enums with multiple schemas

Closed this issue · 0 comments

What happens?

trying to run the following query:
select
i.*
from
postgres_scan('', 'ketteq_planning', 'route') i

and receiving the following error:
SQL Error: java.sql.SQLException: IO Error: Unable to query Postgres: ERROR: type "route_type" does not exist
LINE 1: SELECT unnest(enum_range(NULL::route_type))

the proper query to get enum values should be
SELECT unnest(enum_range(NULL::ketteq_planning.route_type))

i.e. schema is missing - ketteq_planning

To Reproduce

create a schema
create an enum type
create a table that references that enum
try running postgres_scan

OS:

windows

PostgreSQL Version:

14.5

DuckDB Version:

0.6.0

DuckDB Client:

dbeaver

Full Name:

Andrey Kornienko

Affiliation:

ketteQ

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