Search Postgresql Archives

Re: How to create a case-insensitive unique constraint?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Kynn Jones" <kynnjo@xxxxxxxxx> writes:
> ALTER TABLE foo
>   ADD CONSTRAINT foo_unique_xy
>   UNIQUE ( UPPER( x ), UPPER( y ) );

> ...I get a syntax error

This is disallowed by the SQL standard: UNIQUE constraints can only be
on plain columns.  (The practical reason for following their rule is
that there'd be no way to represent more-general constraints in the
information_schema.)

Use the CREATE UNIQUE INDEX syntax instead.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux