Re: Updating two table via a Rule?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "mdavis(at)sevainc(dot)com" <mdavis(at)sevainc(dot)com>
Cc: PostgreSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Updating two table via a Rule?
Date: 2001-01-01 19:21:47
Message-ID: 23360.978376907@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try doing the two inserts in one rule:

CREATE RULE ... DO INSTEAD
(
INSERT INTO ... ;
INSERT INTO ... ;
);

This is the only way of controlling the order in which the actions will
be done; separate rules will be applied in an undefined order.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-01-01 22:01:16 Re: resetting serials and sequences
Previous Message Ferruccio Zamuner 2001-01-01 15:48:35 resetting serials and sequences