Re: Constraints for grouping

From: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Constraints for grouping
Date: 2007-09-04 00:21:13
Message-ID: 46DCA4F9.4030805@productivitymedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


> --- Richard Broersma Jr <rabroersma(at)yahoo(dot)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.
>
>
Thanks for the information. I will check it out and get back to you.

Thanks again,
J

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Luiz K. Matsumura 2007-09-04 03:44:44 Cast on character columns in views
Previous Message chester c young 2007-09-03 21:59:11 Re: Execute SQL statements with 'context'/predefined variables