Re: [GENERAL] questions about query design

2007-03-22 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > Ottavio Campana wrote: >> What I want to do is a function inserting a new item into the table >> ensuring that there is only one record in the table having a particular >> description and at the same time the active field set to true (it might >> seem st

Re: [GENERAL] questions about query design

2007-03-22 Thread Alban Hertroys
Ottavio Campana wrote: > Here's an example of what I'm doing: I have a table like > > create table ( > id serial, > description text not null, > active boolean default true); > > What I want to do is a function inserting a new item into the table > ensuring that there is only one record in

[GENERAL] questions about query design

2007-03-21 Thread Ottavio Campana
Hi, I'm trying to implement some stored procedures but I'm having some doubts, and I'd like to ask you if I'm doing well or not. Here's an example of what I'm doing: I have a table like create table ( id serial, description text not null, active boolean default true); What I want to do is