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

From Cédric Coulon
Subject Re: Retrieve the postgres transaction id
Date
Msg-id 40A0F355.6060507@lina.univ-nantes.fr
Whole thread Raw
In response to Re: Retrieve the postgres transaction id  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Retrieve the postgres transaction id
List pgsql-jdbc
Thx for yours helps.
But Isn't there a possibility that a backend has more than one
transaction with locks?

Cedric.

Tom Lane wrote:

> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

--
Cédric Coulon                       cedric.coulon@lina.univ-nantes.fr
Atlas group, INRIA
LINA - Université de Nantes               voice: +33 (0)2 51 12 59 63
2, Rue de la Houssinière BP 92208         fax  : +33 (0)2 51 12 58 97
44322 Nantes Cedex 03 France

pgsql-jdbc by date:

Previous
From: "David Wall"
Date:
Subject: JDBC and processing large numbers of rows
Next
From: Andy Zeneski
Date:
Subject: Re: Result Set Cursor Patch