1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Some minor tweaks of REINDEX processing: grab exclusive lock a little

earlier, make error checks more uniform.
This commit is contained in:
Tom Lane
2001-11-20 02:46:13 +00:00
parent fb726283b6
commit 604f54cd27
3 changed files with 48 additions and 20 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.122 2001/10/25 05:49:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.123 2001/11/20 02:46:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -865,7 +865,7 @@ ProcessUtility(Node *parsetree,
relname = (char *) stmt->name;
if (IsSystemRelationName(relname))
{
if (!allowSystemTableMods && IsSystemRelationName(relname))
if (!allowSystemTableMods)
elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -O -P options",
relname);
if (!IsIgnoringSystemIndexes())
@ -878,6 +878,15 @@ ProcessUtility(Node *parsetree,
break;
case TABLE:
relname = (char *) stmt->name;
if (IsSystemRelationName(relname))
{
if (!allowSystemTableMods)
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -O -P options",
relname);
if (!IsIgnoringSystemIndexes())
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -P -O options",
relname);
}
if (!pg_ownercheck(GetUserId(), relname, RELNAME))
elog(ERROR, "%s: %s", relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]);
ReindexTable(relname, stmt->force);