disallowing multiple NULLs in a unique constraint
David Garamond <lists@zara.6.isreserved.com>
From: David Garamond <lists@zara.6.isreserved.com>
To: pgsql-general <pgsql-general@postgresql.org>
Date: 2004-02-09T05:06:41Z
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