INSERT RULE QUERY ORDER

From: Justin Tocci <jtocci(at)tlcusa(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: INSERT RULE QUERY ORDER
Date: 2003-08-05 19:14:09
Message-ID: FCC16A7FBE5D074D9E53A8414424E2AC138D11@TLCFWA1NT400
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When my RULE takes the form of:

CREATE RULE name AS ON INSERT TO table DO INSTEAD ( UPDATE query ; INSERT
query) ;

The INSERT query doesn't fire and there is no error. Putting the INSERT
first allows them to both fire. Can anyone tell me why? I think it has
something to do with *NEW* and *OLD* being initialized differently for an
UPDATE than for an INSERT.

I'd like to know what's going on so I can be confident I'm writing my rules
correctly.

Thanks all.

-------------------------------------------
jtocci
Fort Wayne, IN



Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-08-05 19:15:51 Re: multiple insert into's (may be NEWBIE question)
Previous Message Tom Lane 2003-08-05 19:13:27 Re: INSERT RULE QUERY ORDER