diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-10-30 13:03:25 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-10-30 13:04:13 -0400 |
commit | 7f4ece03d675a2a6cb6cec14f564744b5c01e5a4 (patch) | |
tree | 496a663fd9604705e6ae70ce8a5439b232946945 /src/backend/commands/vacuumlazy.c | |
parent | 1c49dae165bcee69bf3327d6ae20271d82cdf6bf (diff) |
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.
Diffstat (limited to 'src/backend/commands/vacuumlazy.c')
-rw-r--r-- | src/backend/commands/vacuumlazy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 5d6d031b481..3778d9d4250 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -309,7 +309,8 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt, new_rel_allvisible, vacrelstats->hasindex, new_frozen_xid, - new_min_multi); + new_min_multi, + false); /* report results to the stats collector, too */ new_live_tuples = new_rel_tuples - vacrelstats->new_dead_tuples; @@ -1377,7 +1378,8 @@ lazy_cleanup_index(Relation indrel, 0, false, InvalidTransactionId, - InvalidMultiXactId); + InvalidMultiXactId, + false); ereport(elevel, (errmsg("index \"%s\" now contains %.0f row versions in %u pages", |