mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
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).
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user