Re: transactions in multiple action rules - Mailing list pgsql-general

From Tom Lane
Subject Re: transactions in multiple action rules
Date
Msg-id 3842.1103611327@sss.pgh.pa.us
Whole thread Raw
In response to transactions in multiple action rules  (Ron Peterson <rpeterso@mtholyoke.edu>)
List pgsql-general
Ron Peterson <rpeterso@mtholyoke.edu> writes:
> Do the multiple actions within a multiple action rule implicitly reside
> within a transaction?

Yes.  In the current code it is actually not possible for a single SQL
command issued by the client to give rise to more than one transaction.
(This might change if we invent some kind of stored-procedure engine, but
rules certainly can't do it.)

> (I want to be sure that I can count on 'currval' returning the sequence
> value returned by the previous action's 'nextval',

As Bruno pointed out, that really has nothing to do with how many
transactions are involved.  The per-session state that currval uses will
sit quietly for as long as you need.

            regards, tom lane

pgsql-general by date:

Previous
From: Marcelo Cid
Date:
Subject: RES: RES: NewsForge Poll: Favorite open source database ?
Next
From: Russ Brown
Date:
Subject: Re: RES: NewsForge Poll: Favorite open source database?