Skip to Content
avatar image
Former Member

[301]: unique constraint violated: Table(P_INDEXES_), Index(IDX_P_INDEXES_PK)

Hello! I faced weird error during creating constraints for table. Three steps to reproduce case:

1) Creating very simple table:

CREATE TABLE "SCHEMA_NAME"."SIMPLE_TABLE" ( "C_INT" INTEGER , "C_CHAR" CHAR(10) );

No any data inserted!

2) Creating check constraint:

ALTER TABLE "SCHEMA_NAME"."SIMPLE_TABLE" ADD CONSTRAINT "C_INT" CHECK("C_INT" BETWEEN 0 AND 100);

3) Creating unique constraint:

ALTER TABLE "SCHEMA_NAME"."SIMPLE_TABLE" ADD CONSTRAINT "UNIK" UNIQUE ("C_CHAR");

At creating unique constraint I'm getting error "[301]: unique constraint violated: Table(P_INDEXES_), Index(IDX_P_INDEXES_PK)".

I tried different names for table and constraints but same result. Have no idea what's happening.

Any suggestions please.

Add comment
10|10000 characters needed characters exceeded

  • Former Member Lars Breddemann

    Checked. No any constraints with this name.

  • Looks like there's something fishy with your database. Maybe there is a corruption in the system tables. You could go and check that with the consistency checks.

    I tried the sequence of commands you provided and that doesn't reproduce your problem. You may consider opening a support incident for this one.

  • Former Member Lars Breddemann

    It seems like you right. Tried this case with another Hana instance and it works as well.

    Thak you for help and advices!

  • Get RSS Feed

0 Answers