Re: [GENERAL] Any plans on allowing user-defined triggers to

2004-10-30 Thread Valentin Militaru
Well, I guess the only moments when you can verify those conditions are when you insert or delete  a project, because it seems logical to me that, at the moment of a department insertion, you will not have any projects related to it, so the constraint you need will automatically be broken. So,

Re: [GENERAL] Any plans on allowing user-defined triggers to be

2004-10-30 Thread Valentin Militaru
You can do that. But first you have to do some optimisations, like:     add a column id(bigserial) to the departamens table, after which you will replace the column department with id_department in the projects table. It is an optimisation, as you are dealing with integer, not text.     After

Re: [GENERAL] Any plans on allowing user-defined triggers to be

2004-10-26 Thread Stephan Szabo
On Tue, 26 Oct 2004, Mike Mascari wrote: > Stephan Szabo wrote: > > On Tue, 26 Oct 2004, Mike Mascari wrote: > > > > > >>I'd like to ensure that the creation of a department also implies the > >>creation of two to eight projects; no more, no less: > > >>Is there no way to achieve the above stated

Re: [GENERAL] Any plans on allowing user-defined triggers to be

2004-10-26 Thread Stephan Szabo
On Tue, 26 Oct 2004, Mike Mascari wrote: > Stephan Szabo wrote: > > On Tue, 26 Oct 2004, Mike Mascari wrote: > > > > > >>I'd like to ensure that the creation of a department also implies the > >>creation of two to eight projects; no more, no less: > > >>Is there no way to achieve the above stated

Re: [GENERAL] Any plans on allowing user-defined triggers to be deferrable?

2004-10-26 Thread Mike Mascari
Stephan Szabo wrote: On Tue, 26 Oct 2004, Mike Mascari wrote: I'd like to ensure that the creation of a department also implies the creation of two to eight projects; no more, no less: Is there no way to achieve the above stated goal in the server? Must I rely on the application to enforce consis

Re: [GENERAL] Any plans on allowing user-defined triggers to be

2004-10-26 Thread Stephan Szabo
On Tue, 26 Oct 2004, Mike Mascari wrote: > I'd like to ensure that the creation of a department also implies the > creation of two to eight projects; no more, no less: > > CREATE TABLE departments ( > department text primary key not null > ); > > CREATE TABLE projects ( > project text primary k

Re: [GENERAL] Any plans on allowing user-defined triggers to be deferrable?

2004-10-26 Thread Mike Mascari
Valentin Militaru wrote: You can do that. But first you have to do some optimisations, like: add a column id(bigserial) to the departamens table, after which you will replace the column department with id_department in the projects table. It is an optimisation, as you are dealing with integer

[GENERAL] Any plans on allowing user-defined triggers to be deferrable?

2004-10-26 Thread Mike Mascari
I'd like to ensure that the creation of a department also implies the creation of two to eight projects; no more, no less: CREATE TABLE departments ( department text primary key not null ); CREATE TABLE projects ( project text primary key not null, department text not null references department