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

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Any plans on allowing user-defined triggers to be deferrable?
Date: 2004-10-26 12:55:53
Message-ID: 417E4959.5080203@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 departments(department)
on delete cascade
on update cascade
);

So it'd be nice to have an INSERT trigger that's fired on departments at
the end of the transaction to ensure that between two and eight projects
exist for the newly created department.

Is there no way to achieve the above stated goal in the server? Must I
rely on the application to enforce consistency?

Mike Mascari

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard_D_Levine 2004-10-26 12:56:00 Re: ON DELETE trigger blocks delete from my table
Previous Message Tino Wildenhain 2004-10-26 12:45:54 Re: Strange count(*) implementation?