Re: Retrieve the postgres transaction id

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Cédric Coulon <cedric(dot)coulon(at)lina(dot)univ-nantes(dot)fr>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Retrieve the postgres transaction id
Date: 2004-05-11 14:16:51
Message-ID: 40A0E053.4090308@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Carlos Barroso 2004-05-11 14:22:58 Re: Can't insert more than 80 registers!?
Previous Message Cédric Coulon 2004-05-11 13:07:02 Retrieve the postgres transaction id