-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
What happens?
When you have table in postgres, containing a column whose type is "array of enum",
running postgres_attach fails with error like this:
Error: IO Error: Unable to query Postgres: ERROR: syntax error at or near "."
LINE 1: SELECT unnest(enum_range(NULL::.myenum))
^
To Reproduce
- Start latest version (15.2) of postgresql locally in docker (but it's also reproducible with older postgres, like 12.11)
docker run \
-p 5432:5432 \
-e POSTGRES_USER=test \
-e POSTGRES_PASSWORD=test \
-e POSTGRES_DB=test \
-e PGDATA=/var/lib/postgresql/data/pgdata \
--tmpfs /var/lib/postgresql/data/pgdata \
postgres:15.2-alpine \
-c log_statement=all
- Connect to test db using psql
psql "host=localhost user=test password=test"
and init simple DB schema using following statements (note the column whose type is array of some enum)
CREATE TYPE myenum as ENUM ('whatever');
CREATE TABLE test (array_of_myenum myenum[]);
- Start duckdb from CLI and try postgres_attach
~/Tmp> duckdb
v0.7.0 f7827396d7
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D LOAD postgres;
D CALL postgres_attach('host=localhost user=test password=test');
Error: IO Error: Unable to query Postgres: ERROR: syntax error at or near "."
LINE 1: SELECT unnest(enum_range(NULL::.myenum))
^
ERROR: syntax error at or near "."
LINE 1: SELECT unnest(enum_range(NULL::.myenum))
^
OS:
Linux - Fedora 36
PostgreSQL Version:
reproduced in 12.11 and 15.2
DuckDB Version:
v0.7.0 f7827396d7
DuckDB Client:
duckdb cli
Full Name:
Jan Hrček
Affiliation:
Holmusk
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
gpsamson, dpprdan and redgeoff
Metadata
Metadata
Assignees
Labels
No labels