Correction

Started by PG Bug reporting formover 3 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/citext.html
Description:

"If you declare a column as UNIQUE or PRIMARY KEY, the implicitly generated
index is case-sensitive. So it's useless for case-insensitive searches, and
it won't enforce uniqueness case-insensitively."

I think the statement above is not correct. I tried creating a PK or unique
key index on a CITEXT column. It checks uniqueness in case-insensitivity.
Here is the error I got when I tried to add a duplicated value 'Des'.

DETAIL: Key (des)=(Des) already exists.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Correction

PG Doc comments form <noreply@postgresql.org> writes:

"If you declare a column as UNIQUE or PRIMARY KEY, the implicitly generated
index is case-sensitive. So it's useless for case-insensitive searches, and
it won't enforce uniqueness case-insensitively."

I think the statement above is not correct. I tried creating a PK or unique
key index on a CITEXT column. It checks uniqueness in case-insensitivity.

That paragraph is talking about what happens when you *don't* use citext.

regards, tom lane