Re: SPI function to investigate query semantics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: SPI function to investigate query semantics
Date: 2004-12-01 21:13:03
Message-ID: 19153.1101935583@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
> So what *is* the appropriate way of starting, releasing, and rolling
> back savepoints then?

We haven't got one that will work from inside arbitrary functions ---
DefineSavepoint and friends don't get it done by themselves, but
expect you to call CommitTransactionCommand/StartTransactionCommand,
and those functions tend to pull the rug out from under the executor.
(I seem to recall trying to do it that way in the first attempt on
plpgsql, and running into all kinds of memory management issues.)

The existing PLs use BeginInternalSubTransaction,
ReleaseCurrentSubTransaction, RollbackAndReleaseCurrentSubTransaction,
but these are subset implementations only suited for
exception-block-structured code.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Oliver Jowett 2004-12-01 21:52:16 Re: libpq and psql not on same page about SIGPIPE
Previous Message Thomas Hallgren 2004-12-01 20:55:40 Re: SPI function to investigate query semantics