Re: Constraints for grouping - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: Constraints for grouping
Date
Msg-id 917951.78388.qm@web31814.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Constraints for grouping  (Richard Broersma Jr <rabroersma@yahoo.com>)
Responses Re: Constraints for grouping
List pgsql-sql
OOPS!
--- Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> CREATE UNIQUE INDEX Only_one_row_true
>           ON Your_table ( featured )
>        WHERE featured = true;
> 
> Or if you want to only allow 1 featured article per catagory then:
> 
> CREATE UNIQUE INDEX Only_one_row_true_per_catagory
>           ON Your_table ( catigories, featured )
>        WHERE featured = true;

I forgot the unique part of the DDL.

Regards,
Richard Broersma Jr.


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Constraints for grouping
Next
From: chester c young
Date:
Subject: Re: Execute SQL statements with 'context'/predefined variables