Constraints for grouping - Mailing list pgsql-sql

From PostgreSQL Admin
Subject Constraints for grouping
Date
Msg-id 46DC5309.8090604@productivitymedia.com
Whole thread Raw
In response to Re: pg & Delphi  (sergio carrasco <a882sacl@yahoo.com.ar>)
Responses Re: Constraints for grouping
List pgsql-sql
I have a question that I've thought in my head about using triggers, but
I figure to ask people that do SQL more than I.  So, I have a table that
I want two columns.

(1) A featured column which is for only 1 row, once it switched to
another row than all other rows must be false
            title              | author_id | categories | featured
--------------------------------+-----------+------+-----Thierry Beta Release           |         3 |         11 |
TrueDifferentApproach  |         3 |         11 |Ottawa Does Not Heart Hip-Hop  |         3 |         11 |
 

(2) A featured column by category and only allow category_feature equal
to the number of categories.

Is SQL the way to go (and how - ideas), or should I use python for the
heavy lifting?

Thanks for any input,
J


pgsql-sql by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Speeding up schema changes
Next
From: "blay bloo"
Date:
Subject: Execute SQL statements with 'context'/predefined variables