Re: IsTransactionState() is being used incorrectly - Mailing list pgsql-hackers

From Tom Lane
Subject Re: IsTransactionState() is being used incorrectly
Date
Msg-id 29478.1184637418@sss.pgh.pa.us
Whole thread Raw
In response to Re: IsTransactionState() is being used incorrectly  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.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
onlyreturntrue for TRANS_INPROGRESS state, which is the only state in whichit's safe to initiate database queries.  It
turnsout that all buttwo of the callers thought that's what it meant; and the other twowere using it as a proxy for
"willGetTopTransactionId() return anonzero XID"?  Since it was in fact an unreliable guide to that,make those two just
invokeGetTopTransactionId() always, then dealwith a zero result if they get one.
 
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: IsTransactionState() is being used incorrectly
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] msvc, build and install with cygwin in the PATH