Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 93E879F9A3C for ; Mon, 3 Sep 2007 21:21:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 50892-01 for ; Mon, 3 Sep 2007 21:21:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ns2.instrumentalyst.com (blk-222-55-203.eastlink.ca [24.222.55.203]) by postgresql.org (Postfix) with ESMTP id 7C55B9F9A3F for ; Mon, 3 Sep 2007 21:21:25 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ns2.instrumentalyst.com (Postfix) with ESMTP id D34CF1635; Mon, 3 Sep 2007 21:17:43 -0300 (ADT) X-Virus-Scanned: amavisd-new at instrumentalyst.com Received: from ns2.instrumentalyst.com ([127.0.0.1]) by localhost (ns2.instrumentalyst.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mfqQrJAie8NI; Mon, 3 Sep 2007 21:17:37 -0300 (ADT) Received: from nakul.home (pool-71-180-50-229.tampfl.fios.verizon.net [71.180.50.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ns2.instrumentalyst.com (Postfix) with ESMTP id B272414B5; Mon, 3 Sep 2007 21:17:36 -0300 (ADT) Message-ID: <46DCA4F9.4030805@productivitymedia.com> Date: Mon, 03 Sep 2007 20:21:13 -0400 From: PostgreSQL Admin User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Richard Broersma Jr CC: pgsql-sql@postgresql.org Subject: Re: Constraints for grouping References: <917951.78388.qm@web31814.mail.mud.yahoo.com> In-Reply-To: <917951.78388.qm@web31814.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.751 tagged_above=0 required=5 tests=AWL=0.110, BAYES_05=-1.11, FH_HOST_ALMOST_IP=1.751 X-Spam-Level: X-Archive-Number: 200709/14 X-Sequence-Number: 29227 > --- Richard Broersma Jr 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