Search code examples
databaserdbmsinformix

Informix - 577: A constraint of the same type already exists on the column set


I'm trying to add following table to my informix DB.

CREATE TABLE UM_MODULE(
    UM_ID SERIAL UNIQUE,
    UM_MODULE_NAME LVARCHAR(100),
    UNIQUE(UM_MODULE_NAME),
    PRIMARY KEY(UM_ID)
);

Then I'm getting a error saying

577: A constraint of the same type already exists on the column set.
Error in line 5
Near character position 13

The description about the error is available at http://www.oninit.com/errorcode/index.php?pageid=-577. But why this error occur in my case where I haven't used any duplicate constraints? How can I fix this?


Solution

  • The declaration of UM_ID as both unique and primary key is redundant. Just drop the unique constraint because primary keys are already unique (and not null).