I'm on DuckDB 1.4.1 experiencing difficulty updating a Postgres 17.6 ENUM field status:
CREATE TYPE mystatus_enum AS ENUM (
'IN_STOCK', 'OUT_OF_STOCK', 'NOT_FOUND', 'NOT_A_PRODUCT'
);
CREATE TABLE mytable
(
id INTEGER primary key,
status mystatus_enum
);
All of the following give me:
Not implemented Error: Enums in Postgres must be named - unnamed enums are not supported. Use CREATE TYPE to create a named enum.
Making a similar update from within Postgres without DuckDB is not a problem.
Both for DuckDB sources:
update mypg.mytable set status=ddb.status where ddb.id=mypg.mytable.id;
update mypg.mytable set status=ddb.status::varchar where ddb.id=mypg.mytable.id;
update mypg.mytable set status=ddb.status::text where ddb.id=mypg.mytable.id;
update mypg.mytable set status=ddb.status::mypg.mystatus_enum where ddb.id=mypg.mytable.id;
and PG sources:
update mypg.mytable set status=mypg.mytable2.status where mypg.mytable2.id=mypg.mytable.id;
and as above but with PG sources.
I've also tried using an equivalent ENUM declared in DuckDB.
Any suggestions for how I can avoid this error? I'd like to avoid my last resort of switching the Postgres field from ENUM to VARCHAR as it is a very large and active table.
mypg.mytable.CREATE TYPE mystatus_enum AS ENUM ( 'IN_STOCK', 'OUT_OF_STOCK', 'NOT_FOUND', 'NOT_A_PRODUCT');is not being seen asnamed. My guess is something in the extension code is not picking up the correct information from the system catalogs. I would suggest filing an issue here DuckDB-Postgres Issues