RE: Triggers and RI-style behavior.

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: RE: Triggers and RI-style behavior.
Date: 2001-02-16 13:58:03
Message-ID: 01C097F6.92E082F0.mascarm@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oops. I see them now in pg_dump. Sorry for the noise.

Mike Mascari

-----Original Message-----
From: Mike Mascari [SMTP:mascarm(at)mascari(dot)com]
Sent: Friday, February 16, 2001 8:29 AM
To: 'pgsql-general(at)postgresql(dot)org'
Subject: Triggers and RI-style behavior.

Hello.

I was wondering if anyone could give me an example of a CREATE TRIGGER
statement which mimics the behavior of the integrated R.I. in version 7. I
have the need to create triggers which do some RI-style things but cannot
be declared appropriately using ALTER TABLE ADD CONSTRAINT. I know there
are issues with MVCC which made the old refint.c obsolete. If, for example,
I want to update table2 when a field in table1 changes, should I use a
trigger like:

CREATE TRIGGER t_table1
AFTER UPDATE ON table1
FOR EACH ROW EXECUTE PROCEDURE bar();

where bar() is a PL/pgSQL block to update table2.

Or should it be FOR EACH STATEMENT?

Thanks for any information,

Mike Mascari
mascarm(at)mascari(dot)com

Browse pgsql-general by date

  From Date Subject
Next Message Mirko Zeibig 2001-02-16 14:04:26 Re: PostgreSQL over NFS?
Previous Message Mikhail V. Majorov 2001-02-16 13:56:20 Re: function likes sprintf