Re: unique index with bool

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: tmpmac(at)mac(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unique index with bool
Date: 2005-05-19 15:22:14
Message-ID: 428CAF26.9060702@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tmpmac(at)mac(dot)com wrote:
> CREATE UNIQUE INDEX name on table(param1,param2);
>
> How to create such unique index when param2 is bool type, and this param2 should be accepted only in case of true ?
>
> I tried: CREATE UNIQUE INDEX name on table(param1,(param2 = 'true'));
> but it's not working.

CREATE UNIQUE INDEX name ON table(param1, param2) WHERE param2 = true;

Regards,

--
Alban Hertroys
MAG Productions

T: +31(0)53 4346874
F: +31(0)53 4346876
E: alban(at)magproductions(dot)nl
W: http://www.magproductions.nl

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-05-19 15:26:34 Re: [GENERAL] Postgres in government
Previous Message Martijn van Oosterhout 2005-05-19 15:21:25 Re: Count and Results together