pgsql: Test IsInTransactionChain, not IsTransactionBlock, in vac_update

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Test IsInTransactionChain, not IsTransactionBlock, in vac_update
Date: 2014-10-30 17:04:23
Message-ID: E1Xjt95-0003Va-Q7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats.

As noted by Noah Misch, my initial cut at fixing bug #11638 didn't cover
all cases where ANALYZE might be invoked in an unsafe context. We need to
test the result of IsInTransactionChain not IsTransactionBlock; which is
notationally a pain because IsInTransactionChain requires an isTopLevel
flag, which would have to be passed down through several levels of callers.
I chose to pass in_outer_xact (ie, the result of IsInTransactionChain)
rather than isTopLevel per se, as that seemed marginally more apropos
for the intermediate functions to know about.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e65b550b37ec25102813d8e39eeb70f0c7944433

Modified Files
--------------
src/backend/commands/analyze.c | 19 ++++++++++++-------
src/backend/commands/vacuum.c | 21 ++++++++++++---------
src/backend/commands/vacuumlazy.c | 6 ++++--
src/include/commands/vacuum.h | 5 +++--
4 files changed, 31 insertions(+), 20 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2014-10-30 19:02:34 pgsql: Extend dsm API with a new function dsm_unpin_mapping.
Previous Message Robert Haas 2014-10-30 15:49:54 pgsql: "Pin", rather than "keep", dynamic shared memory mappings and se