Re: IsTransactionState() is being used incorrectly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: IsTransactionState() is being used incorrectly
Date: 2007-07-17 01:56:58
Message-ID: 29478.1184637418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> We could fix this either by changing the definition of
>> IsTransactionState() or by introducing another test function with
>> a different name. Any thoughts which is preferable?

> Is this done or should it be kept for 8.4?

Fixed, I thought ... yeah, here:

2007-06-07 17:45 tgl

* src/backend/: access/transam/xact.c, storage/ipc/procarray.c,
utils/error/elog.c: Redefine IsTransactionState() to only return
true for TRANS_INPROGRESS state, which is the only state in which
it's safe to initiate database queries. It turns out that all but
two of the callers thought that's what it meant; and the other two
were using it as a proxy for "will GetTopTransactionId() return a
nonzero XID"? Since it was in fact an unreliable guide to that,
make those two just invoke GetTopTransactionId() always, then deal
with a zero result if they get one.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-07-17 02:45:46 Re: [HACKERS] msvc, build and install with cygwin in the PATH
Previous Message Bruce Momjian 2007-07-17 01:54:50 Re: IsTransactionState() is being used incorrectly