pgsql: Redefine IsTransactionState() to only return true for - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Redefine IsTransactionState() to only return true for
Date
Msg-id 20070607214600.5BADA9FB919@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xact.c (r1.244 -> r1.245)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c.diff?r1=1.244&r2=1.245)
    pgsql/src/backend/storage/ipc:
        procarray.c (r1.25 -> r1.26)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/ipc/procarray.c.diff?r1=1.25&r2=1.26)
    pgsql/src/backend/utils/error:
        elog.c (r1.185 -> r1.186)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.185&r2=1.186)

pgsql-committers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: pgsql: Rework temp_tablespaces patch so that temptablespaces are
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Arrange for large sequential scans to synchronize with each