-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hello,
We've noticed that some (PostgreSQL) SQL schema files contain duplicate column names - Type and type in case of the Agent table.
CREATE TYPE Agent_type AS ENUM ('Agent');
CREATE TABLE Agent (Type TEXT, address JSON, areaServed TEXT, id TEXT PRIMARY KEY, location JSON, name JSON, type Agent_type);Out of the box such a SQL statement won't work - it'll report a duplicate column name. Quoting both type columns so that they become "Type" and "type" seems to fix the issue in PostgreSQL. DuckDB doesn't seem to support this even with the quoted column names, even though it's trying to be compatible with PostgreSQL.
By the way, are the type columns and single type enums in Smart Data Model SQL schema files even necessary since the same value is also used for the table names? Removing them could be a possible solution for this issue and make the SQL schema files work in multiple (somewhat PostgreSQL compatible) databases, not just PostgreSQL.
Thanks!