mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
change reindex ERROR/NOTICE message
This commit is contained in:
parent
282861ad75
commit
56e09ddf0c
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.25 2000/04/25 02:45:54 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.26 2000/04/25 10:38:38 inoue Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -714,7 +714,8 @@ ReindexIndex(const char *name, bool force /* currently unused */ )
|
|||||||
((Form_pg_class) GETSTRUCT(tuple))->relkind);
|
((Form_pg_class) GETSTRUCT(tuple))->relkind);
|
||||||
}
|
}
|
||||||
|
|
||||||
reindex_index(tuple->t_data->t_oid, force);
|
if (!reindex_index(tuple->t_data->t_oid, force))
|
||||||
|
elog(NOTICE, "index '%s' wasn't reindexed", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -744,7 +745,8 @@ ReindexTable(const char *name, bool force)
|
|||||||
((Form_pg_class) GETSTRUCT(tuple))->relkind);
|
((Form_pg_class) GETSTRUCT(tuple))->relkind);
|
||||||
}
|
}
|
||||||
|
|
||||||
reindex_relation(tuple->t_data->t_oid, force);
|
if (!reindex_relation(tuple->t_data->t_oid, force))
|
||||||
|
elog(NOTICE, "table '%s' wasn't reindexed", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -806,7 +808,6 @@ ReindexDatabase(const char *dbname, bool force, bool all)
|
|||||||
elog(ERROR, "REINDEX DATABASE: Can be executed only on the currently open database.");
|
elog(ERROR, "REINDEX DATABASE: Can be executed only on the currently open database.");
|
||||||
|
|
||||||
heap_close(relation, NoLock);
|
heap_close(relation, NoLock);
|
||||||
/** reindex_database(db_id, force, !all); **/
|
|
||||||
|
|
||||||
CommonSpecialPortalOpen();
|
CommonSpecialPortalOpen();
|
||||||
pmem = CommonSpecialPortalGetMemory();
|
pmem = CommonSpecialPortalGetMemory();
|
||||||
@ -847,7 +848,8 @@ ReindexDatabase(const char *dbname, bool force, bool all)
|
|||||||
for (i = 0; i < relcnt; i++)
|
for (i = 0; i < relcnt; i++)
|
||||||
{
|
{
|
||||||
StartTransactionCommand();
|
StartTransactionCommand();
|
||||||
reindex_relation(relids[i], force);
|
if (reindex_relation(relids[i], force))
|
||||||
|
elog(NOTICE, "relation %d was reindexed", relids[i]);
|
||||||
CommitTransactionCommand();
|
CommitTransactionCommand();
|
||||||
}
|
}
|
||||||
CommonSpecialPortalClose();
|
CommonSpecialPortalClose();
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.86 2000/04/12 17:15:43 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.87 2000/04/25 10:38:38 inoue Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -865,10 +865,10 @@ ProcessUtility(Node *parsetree,
|
|||||||
if (IsSystemRelationName(relname))
|
if (IsSystemRelationName(relname))
|
||||||
{
|
{
|
||||||
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
||||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -O -P options",
|
||||||
relname);
|
relname);
|
||||||
if (!IsIgnoringSystemIndexes())
|
if (!IsIgnoringSystemIndexes())
|
||||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -P -O options",
|
||||||
relname);
|
relname);
|
||||||
}
|
}
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
@ -882,10 +882,11 @@ ProcessUtility(Node *parsetree,
|
|||||||
if (IsSystemRelationName(relname))
|
if (IsSystemRelationName(relname))
|
||||||
{
|
{
|
||||||
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
||||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -O -P options",
|
||||||
relname);
|
relname);
|
||||||
if (!IsIgnoringSystemIndexes())
|
if (!IsIgnoringSystemIndexes())
|
||||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -P -O options",
|
||||||
|
|
||||||
relname);
|
relname);
|
||||||
}
|
}
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
@ -897,9 +898,9 @@ ProcessUtility(Node *parsetree,
|
|||||||
case DATABASE:
|
case DATABASE:
|
||||||
relname = (char *) stmt->name;
|
relname = (char *) stmt->name;
|
||||||
if (!allowSystemTableMods)
|
if (!allowSystemTableMods)
|
||||||
elog(ERROR, "-O option is needed");
|
elog(ERROR, "must be called under standalone postgres with -O -P options");
|
||||||
if (!IsIgnoringSystemIndexes())
|
if (!IsIgnoringSystemIndexes())
|
||||||
elog(ERROR, "-P option is needed");
|
elog(ERROR, "must be called under standalone postgres with -P -O options");
|
||||||
ReindexDatabase(relname, stmt->force, false);
|
ReindexDatabase(relname, stmt->force, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user