Re: Retrieve the postgres transaction id

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Cédric Coulon <cedric(dot)coulon(at)lina(dot)univ-nantes(dot)fr>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Retrieve the postgres transaction id
Date: 2004-05-11 15:07:45
Message-ID: 10080.1084288065@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver Jowett <oliver(at)opencloud(dot)com> writes:
> (later) A bit of experimentation yields this (I'm sure there's a better
> way):
> select transaction from pg_locks where pid = pg_backend_pid();

You'd need to qualify that more, since as-is it will also show rows for
other locks the transaction holds. Possibly "where transaction is not
null" will be sufficient.

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2004-05-11 15:37:14 JDBC and processing large numbers of rows
Previous Message Carlos Barroso 2004-05-11 14:22:58 Re: Can't insert more than 80 registers!?