1

I need to create a unique constraint on citext column, but it fails. Here is the example:

create table test (name citext);

ALTER TABLE ONLY test
    ADD CONSTRAINT test_name_uq UNIQUE (name);

  insert into test(name) values ('SIMIT'); --succeded.

  insert into test(name) values ('SİMİT'); --failed

Here is the error code:

ERROR: duplicate key value violates unique constraint "test_name_uq" DETAIL: Key (name)=(SİMİT) already exists. SQL state: 23505

SIMIT and SİMİT is not the same thing. It should not return an error. I don't want to add any upper or lower function in my code. Is there any suggestion?

Banu Akkus
  • 389
  • 1
  • 3
  • 11

0 Answers0