Re: BUG #5081: ON INSERT rule does not work correctly - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5081: ON INSERT rule does not work correctly
Date
Msg-id 22436.1253982918@sss.pgh.pa.us
Whole thread Raw
In response to BUG #5081: ON INSERT rule does not work correctly  ("Stefan" <sb@drbott.de>)
Responses Re: BUG #5081: ON INSERT rule does not work correctly  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
"Stefan" <sb@drbott.de> writes:
> The problem is that if it is no record in the table, it seems that first the
> INSERT command is issued and after that the UPDATE command is issued, too.

Well, yeah.  That's exactly how it's documented to work: an ON INSERT
rule is executed after the INSERT proper.

You could maybe make this work with a BEFORE INSERT trigger.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Kris Jurka
Date:
Subject: Re: [JDBC] BUG #5058: [jdbc] Silent failure with executeUpdate()
Next
From: Tom Lane
Date:
Subject: Re: BUG #5076: LEFT OUTER JOIN and WHERE madness