>I believe you can add partial unique indexes to cover the case where a
>column is null, but if you have multiple nullable columns you need to
>worry about you end up with a bunch of indexes.
Hmmm. I hadn't thought of that, thanks. Yes, the indexes would be unnessecary
though. Speaking of, shou
gsql-sql@postgresql.org
Subject: Re: [SQL] multi-column unique constraints with nullable columns
It may be possible to bypass the NULL != NULL by using coalesce. Here
is an example:
create table foo2 (
a integer not null,
b integer not null,
c integer null,
UNIQUE (a,b,c)
);
create function fo
It may be possible to bypass the NULL != NULL by using coalesce. Here
is an example:
create table foo2 (
a integer not null,
b integer not null,
c integer null,
UNIQUE (a,b,c)
);
create function foo2_unique_func() RETURNS trigger AS '
DECLARE
isfound integer = 0;
BEGIN
isfound =
On Sat, 30 Apr 2005, Tornroth, Phill wrote:
> >I believe you can add partial unique indexes to cover the case where a
> >column is null, but if you have multiple nullable columns you need to
> >worry about you end up with a bunch of indexes.
>
> Hmmm. I hadn't thought of that, thanks. Yes, the ind
On Fri, 29 Apr 2005, Tornroth, Phill wrote:
> I have many tables who's natural key includes a nullable column. In this
> cases it's a soft-delete or 'deprecated' date time. I'd like to add a
> table constraint enforcing this constraint without writing a custom
> procedure, but I've found that post
I have many tables who's natural key includes a nullable column. In this cases
it's a soft-delete or 'deprecated' date time. I'd like to add a table
constraint enforcing this constraint without writing a custom procedure, but
I've found that postgres treats NULLs very consistently with respect