X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AEF33D1B3E4 for ; Tue, 11 May 2004 11:17:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 16158-03 for ; Tue, 11 May 2004 11:17:07 -0300 (ADT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id D7F61D1B3CD for ; Tue, 11 May 2004 11:17:02 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BNY3z-0007RM-00; Wed, 12 May 2004 02:16:55 +1200 Message-ID: <40A0E053.4090308@opencloud.com> Date: Wed, 12 May 2004 02:16:51 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?C=E9dric_Coulon?= Cc: pgsql-jdbc@postgresql.org Subject: Re: Retrieve the postgres transaction id References: <40A0CFF6.502@lina.univ-nantes.fr> In-Reply-To: <40A0CFF6.502@lina.univ-nantes.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/52 X-Sequence-Number: 10062 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