Menu

#1460 Scripts -> Create Table on Oracle creates redundant index.

SQuirreL
closed-fixed
nobody
None
medium
2021-02-22
2021-02-16
No

Consider the following script, generated with SquirrelSQL, Scripts -> Create Table on Oracle...

CREATE TABLE "IBIS"."SITUATION_OBSERVATION"
(
   SIT_OBS_ID decimal(8,0) PRIMARY KEY NOT NULL,
   CODE varchar2(512),
   NOTES varchar2(4000),
   CREATED_BY varchar2(30),
   CREATE_DATE timestamp,
   UPDATED_BY varchar2(30),
   UPDATE_DATE timestamp
)
;
CREATE UNIQUE INDEX SYS_C00212051 ON "IBIS"."SITUATION_OBSERVATION"(SIT_OBS_ID)
;

The CREATE UNIQUE INDEX.... is redundant. Oracle creates a unique index because of the PRIMARY KEY clause. If you try and run this you get the error ORA-01408: such column list already indexed

Discussion

  • Gerd Wagner

    Gerd Wagner - 2021-02-22
    • status: open --> closed-fixed
     
  • Gerd Wagner

    Gerd Wagner - 2021-02-22

    Fixed in our GIT repository will be available in future snapshots and versions.

     

Log in to post a comment.