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

From Oliver Jowett
Subject Re: Retrieve the postgres transaction id
Date
Msg-id 40A0E053.4090308@opencloud.com
Whole thread Raw
In response to Retrieve the postgres transaction id  (Cédric Coulon <cedric.coulon@lina.univ-nantes.fr>)
Responses Re: Retrieve the postgres transaction id
List pgsql-jdbc
Cédric Coulon wrote:
> Hi,
>
> Is there a way to retrieve the postgres transaction id using JDBC?

There's no special JDBC path for doing this.

(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 should be able to run that as a normal query through JDBC.

-O

pgsql-jdbc by date:

Previous
From: Cédric Coulon
Date:
Subject: Retrieve the postgres transaction id
Next
From: Carlos Barroso
Date:
Subject: Re: Can't insert more than 80 registers!?