diff options
| author | Tom Lane | 2006-01-04 19:16:32 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-01-04 19:16:32 +0000 |
| commit | f3366134388dd257e0b30cfc12417de3c7d80235 (patch) | |
| tree | 7fc2b7c194eed9354e20f4e6b2a709a3a0471dd4 /src | |
| parent | f5b50af2917610ccae56c8280eaf4562310b635c (diff) | |
Fix another case in which autovacuum would fail while analyzing
expressional indexes. Per report from Brian Hirt.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/commands/vacuum.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index e83a8333d2d..c7e387c3b8b 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.317.2.1 2005/11/22 18:23:08 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.317.2.2 2006/01/04 19:16:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -510,6 +510,14 @@ vacuum(VacuumStmt *vacstmt, List *relids) * PostgresMain(). */ StartTransactionCommand(); + /* + * Re-establish the transaction snapshot. This is wasted effort + * when we are called as a normal utility command, because the + * new transaction will be dropped immediately by PostgresMain(); + * but it's necessary if we are called from autovacuum because + * autovacuum might continue on to do an ANALYZE-only call. + */ + ActiveSnapshot = CopySnapshot(GetTransactionSnapshot()); } if (vacstmt->vacuum) |
