What order of steps of the postgres when you change information in the table?

From: Denis Feklushkin <denis(dot)feklushkin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: What order of steps of the postgres when you change information in the table?
Date: 2009-10-31 02:12:29
Message-ID: 20091031091229.4c96b85b@db
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Problem:
It is necessary to synchronize the "users" table with an
external storage of passwords (krb5)

I made a trigger:

CREATE TRIGGER "10_krb5"
AFTER INSERT OR UPDATE OR DELETE
ON users
FOR EACH ROW
EXECUTE PROCEDURE user2krb5_python();

Everything works, except that when you delete a row from table
"users" foreign keys checking occurs after this trigger. And in case
of any problems with the referencing record is an exception,
rollback is occured (this is ok), but the trigger user2krb5_python() was
executed and the user from the external storage removed.

Checking of foreign keys occurs after the "AFTER-trigger" is ok? Check
of the primary key, unique, and other constraints occurs in the very
beginning, I checked.


(sorry for my English)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-10-31 05:29:49 Re: What order of steps of the postgres when you change information in the table?
Previous Message Scott Marlowe 2009-10-30 23:41:02 Re: Rewriting select statements