Re: partial unique constraint

Rod Taylor <rbt@rbt.ca>

From: Rod Taylor <rbt@rbt.ca>
To: Robert Treat <xzilla@users.sourceforge.net>
Cc: pgsql-sql@postgresql.org
Date: 2004-04-06T15:17:49Z
Lists: pgsql-sql
On Tue, 2004-04-06 at 10:29, Robert Treat wrote:
> Trying to come up with the proper syntax to meet the following criteria:
> 
> create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); 

Tt takes 2 steps.

CREATE TABLE ...
CREATE UNIQUE INDEX ... (bar) WHERE baz = true;

-- 
Rod Taylor <rbt [at] rbt [dot] ca>

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
PGP Key: http://www.rbt.ca/signature.asc