Re: Detecting uncommitted changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Detecting uncommitted changes
Date: 2011-12-28 00:41:54
Message-ID: 17932.1325032914@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> Tom Lane wrote on 27.12.2011 20:22:
>> More specifically, look to see if the current transaction has assigned
>> itself a transaction ID. I think the easiest place to see this is in
>> pg_locks --- it will be holding exclusive lock on a TransactionId object
>> if so.

> Thanks for the answer. I came up with the following statement:

> select count(*)
> from pg_locks
> where pid = pg_backend_pid()
> and locktype in ('transactionid')

> does that look right to you?

No. You forgot the exclusive-lock condition.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Donald 2011-12-28 05:19:38 PostgreSQL 9.1 pg_dump setval() sets wrong value
Previous Message Merlin Moncure 2011-12-27 23:20:20 Re: Kindly Please Help Me