[
https://issues.jboss.org/browse/TEIIDDES-1211?page=com.atlassian.jira.plu...
]
Van Halbert commented on TEIIDDES-1211:
---------------------------------------
Not that I don't want to give u the information, but to duplicate, use any model,
export DDL, select Postgres as the database type. Also, make sure the table has an index
defined so that the CREATE INDEX statement will be generated. You should see that the
name of the index is the same name as the CREATE TABLE, which is invalid.
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_IDX 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:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira