]
Van Halbert updated TEIIDDES-1211:
----------------------------------
Attachment: tpc_postgres.ddl
Exported DDL
Exporting DDL for Postgres produces invalid CREATE INDEX statement
because duplicate object names in database
-------------------------------------------------------------------------------------------------------------
Key: TEIIDDES-1211
URL:
https://issues.jboss.org/browse/TEIIDDES-1211
Project: Teiid Designer
Issue Type: Bug
Components: Import/Export
Affects Versions: 7.4.2
Reporter: Van Halbert
Attachments: tpc_postgres.ddl
Trying to execute DDL on postgres database produces this error:
Error: ERROR: relation "orders" already exists
SQLState: 42P07
ErrorCode: 0
Error occured in:
CREATE INDEX ORDERS ON ORDERS (O_CUSTKEY)
----
The problem was resolved if I changed ORDERS index name:
CREATE INDEX ORDERS ON ORDERS (O_CUSTKEY);
----
Here's a statement I found on the Postgres Naming rules:
The names of all objects must be unique within some scope. Every database must have a
unique name; the name of a schema must be unique within the scope of a single database,
the name of a table must be unique within the scope of a single schema, and column names
must be unique within a table. The name of an index must be unique within a database.
I would like to suggest that all index names that are created are appended with
"idx" or something similar. Right now, the first looks to be the name of the
table, and subsequent names have 1,2, etc. appended.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: