Search Postgresql Archives

Re: Re: how to implement a foreign key type constraint against a not unique column

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

 



On Jan 25, 2009, at 3:07 AM, Jasen Betts wrote:

I want to use this column as a foreign key on a column in another table
(column 2), but cannot without a full unique index.

a full unique index is easy use an expression that's null for -1.

create unique index foobar on foo( ( case fee when -1 then null else fee end ) );


anything wrong with create unique index foobar on foo where fee <> -1 ?

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,497f50e9747031810420427!



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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