Re: Retrieve the postgres transaction id - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: Retrieve the postgres transaction id
Date
Msg-id 10080.1084288065@sss.pgh.pa.us
Whole thread Raw
In response to Re: Retrieve the postgres transaction id  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Retrieve the postgres transaction id
List pgsql-jdbc
Oliver Jowett <oliver@opencloud.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

pgsql-jdbc by date:

Previous
From: Carlos Barroso
Date:
Subject: Re: Can't insert more than 80 registers!?
Next
From: "David Wall"
Date:
Subject: JDBC and processing large numbers of rows