Re: transactions in multiple action rules

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Peterson <rpeterso(at)mtholyoke(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: transactions in multiple action rules
Date: 2004-12-21 06:42:07
Message-ID: 3842.1103611327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron Peterson <rpeterso(at)mtholyoke(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Russ Brown 2004-12-21 07:52:31 Re: RES: NewsForge Poll: Favorite open source database?
Previous Message Bruno Wolff III 2004-12-21 05:28:34 Re: transactions in multiple action rules