Trigger/Rules Order of operations

From: Ketema Harris <ketema(at)ketema(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Trigger/Rules Order of operations
Date: 2008-12-15 17:49:13
Message-ID: 1759836C-5DC8-4886-BE33-F06694BFA15B@ketema.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am interested in finding out the pros, cons, pitfalls of using the
following design:

Manual insert into Table A.
Table A has a BEFORE INSERT trigger that causes an insert to table B.
Table B has an AFTER INSERT trigger that causes an insert back to
table A (With different criteria not an endless loop)

Table A will have its Before Trig fire again and this time the
criteria causes it to finish with a return new.

Will the second insert into table A commit before the first insert
into table A? What order does the insert into table B finish up?

Ketema J. Harris
www.ketema.net
ketema(at)ketema(dot)net
ketemaj on iChat

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 2008-12-15 17:55:02 How restrict select on a view ?
Previous Message Tom Lane 2008-12-15 16:45:09 Re: Setting NEW in AFTER trigger