On Sat, Jan 29, 2005 at 01:04:36PM +0100, Michael Paesold wrote:
> Greg Sabino Mullane wrote:
>
> >Michael Paesold wrote:
> >>2) Implement a server-side function to get the savepoints from the server
> >>and query that before every release.
> >
> >I could not find a way to do this. Is there any interface to the list?
>
> Alvaro suggested to implement such a function. It is not there yet. I think
> you would have to access the sub xact stack, but I have not looked into
> that code for quite some time.
> http://archives.postgresql.org/pgsql-general/2004-10/msg00370.php
The only problem with this idea is that the function cannot be run when
the transaction is in aborted state. Not sure if that is a problem or
not. What happens if the user does
SAVEPOINT foo; SLECT 1; ROLLBACK TO foo;
all in one command in psql?
I know psql sends that as three commands, so maybe it's not an issue.
--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Doing what he did amounts to sticking his fingers under the hood of the
implementation; if he gets his fingers burnt, it's his problem." (Tom Lane)