summaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-10-19 20:15:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-10-19 20:15:09 +0000
commit60992456ed00b52f90e47a736ace12668b881225 (patch)
tree9b8b7f69c41d5f96dbfd2fd0d4ddeb81ef52c2c7 /src/backend/commands/vacuum.c
parentc1f91a38e20864c14650794a64d52f2d6c900e0f (diff)
downloadpostgresql-60992456ed00b52f90e47a736ace12668b881225.tar.gz
Invert logic in pg_exec_query_string() so that we set a snapshot for
all utility statement types *except* a short list, per discussion a few days ago. Add missing SetQuerySnapshot calls in VACUUM and REINDEX, and guard against calling REINDEX DATABASE from a function (has same problem as VACUUM).
Diffstat (limited to 'src/backend/commands/vacuum.c')
-rw-r--r--src/backend/commands/vacuum.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index ba2aae5766..2ff3aae6f8 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.241 2002/09/27 20:57:08 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.242 2002/10/19 20:15:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -306,7 +306,10 @@ vacuum(VacuumStmt *vacstmt)
* multiple tables).
*/
if (vacstmt->vacuum)
+ {
StartTransactionCommand(true);
+ SetQuerySnapshot(); /* might be needed for functional index */
+ }
else
old_context = MemoryContextSwitchTo(anl_context);
@@ -724,6 +727,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
/* Begin a transaction for vacuuming this relation */
StartTransactionCommand(true);
+ SetQuerySnapshot(); /* might be needed for functional index */
/*
* Check for user-requested abort. Note we want this to be inside a