disallowing multiple NULLs in a unique constraint

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: disallowing multiple NULLs in a unique constraint
Date: 2004-02-09 05:06:41
Message-ID: 40271561.8080206@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

SQL Server only allow one NULL in a unique constraint column (it's the
unique index that does that, so the unique constraint behaves like that
too). The question is, what is the best way to simulate that behaviour
in Postgres? Can a CHECK constraint does that? Will a trigger with
SELECT count(*) ... WHERE f IS NULL be too slow if the table is large?

--
dave

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-02-09 05:22:31 Re: fsync = true beneficial on ext3?
Previous Message Marc G. Fournier 2004-02-09 04:52:13 Re: Fwd: Favorite DB poll on ORA