Re: Transaction IDs not the same in same transaction?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Steve V <dndlists(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Transaction IDs not the same in same transaction?
Date: 2005-10-23 22:52:44
Message-ID: 20051023225244.GA26069@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Oct 23, 2005 at 02:00:47PM -0700, Steve V wrote:
> > Ah, you had not even mentioned that the trigger was in pltcl.
> > spi_exec runs everything in subtransactions as of 8.0, so that
> > it can catch errors and propagate them back as Tcl errors.
>
> Okay, so are there any possible options? Would GetTopTransactionId()
> work, as Michael suggested further up?

I just did some tests with a pltcl function that uses spi_exec in
an AFTER trigger and GetTopTransactionId() returned the same value
for each of several inserts and updates that were in the same
transaction. However, I can't say whether this will work for you
without seeing your code. It would be easier for us to help -- and
you'd get a solution sooner -- if you'd post a minimal but complete
example that shows what you're doing and that exhibits the behavior
you're seeing.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve V 2005-10-23 23:35:14 Re: Transaction IDs not the same in same transaction?
Previous Message Steve V 2005-10-23 21:00:47 Re: Transaction IDs not the same in same transaction?