Skip site navigation (1) Skip section navigation (2)

Re: Retrieve the postgres transaction id

From: Cédric Coulon <cedric(dot)coulon(at)lina(dot)univ-nantes(dot)fr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Retrieve the postgres transaction id
Date: 2004-05-11 15:37:57
Message-ID: 40A0F355.6060507@lina.univ-nantes.fr (view raw or flat)
Thread:
Lists: 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(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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
Cédric Coulon                       cedric(dot)coulon(at)lina(dot)univ-nantes(dot)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

In response to

Responses

pgsql-jdbc by date

Next:From: Andy ZeneskiDate: 2004-05-11 16:57:43
Subject: Re: Result Set Cursor Patch
Previous:From: David WallDate: 2004-05-11 15:37:14
Subject: JDBC and processing large numbers of rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group