Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 56e09dd

Browse files
author
Hiroshi Inoue
committed
change reindex ERROR/NOTICE message
1 parent 282861a commit 56e09dd

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

src/backend/commands/indexcmds.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.25 2000/04/25 02:45:54 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.26 2000/04/25 10:38:38 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -714,7 +714,8 @@ ReindexIndex(const char *name, bool force /* currently unused */ )
714714
((Form_pg_class) GETSTRUCT(tuple))->relkind);
715715
}
716716

717-
reindex_index(tuple->t_data->t_oid, force);
717+
if (!reindex_index(tuple->t_data->t_oid, force))
718+
elog(NOTICE, "index '%s' wasn't reindexed", name);
718719
}
719720

720721
/*
@@ -744,7 +745,8 @@ ReindexTable(const char *name, bool force)
744745
((Form_pg_class) GETSTRUCT(tuple))->relkind);
745746
}
746747

747-
reindex_relation(tuple->t_data->t_oid, force);
748+
if (!reindex_relation(tuple->t_data->t_oid, force))
749+
elog(NOTICE, "table '%s' wasn't reindexed", name);
748750
}
749751

750752
/*
@@ -806,7 +808,6 @@ ReindexDatabase(const char *dbname, bool force, bool all)
806808
elog(ERROR, "REINDEX DATABASE: Can be executed only on the currently open database.");
807809

808810
heap_close(relation, NoLock);
809-
/** reindex_database(db_id, force, !all); **/
810811

811812
CommonSpecialPortalOpen();
812813
pmem = CommonSpecialPortalGetMemory();
@@ -847,7 +848,8 @@ ReindexDatabase(const char *dbname, bool force, bool all)
847848
for (i = 0; i < relcnt; i++)
848849
{
849850
StartTransactionCommand();
850-
reindex_relation(relids[i], force);
851+
if (reindex_relation(relids[i], force))
852+
elog(NOTICE, "relation %d was reindexed", relids[i]);
851853
CommitTransactionCommand();
852854
}
853855
CommonSpecialPortalClose();

src/backend/tcop/utility.c

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.86 2000/04/12 17:15:43 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.87 2000/04/25 10:38:38 inoue Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -865,11 +865,11 @@ ProcessUtility(Node *parsetree,
865865
if (IsSystemRelationName(relname))
866866
{
867867
if (!allowSystemTableMods && IsSystemRelationName(relname))
868-
elog(ERROR, "class \"%s\" is a system catalog index",
869-
relname);
868+
elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -O -P options",
869+
relname);
870870
if (!IsIgnoringSystemIndexes())
871-
elog(ERROR, "class \"%s\" is a system catalog index",
872-
relname);
871+
elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -P -O options",
872+
relname);
873873
}
874874
#ifndef NO_SECURITY
875875
if (!pg_ownercheck(userName, relname, RELNAME))
@@ -882,11 +882,12 @@ ProcessUtility(Node *parsetree,
882882
if (IsSystemRelationName(relname))
883883
{
884884
if (!allowSystemTableMods && IsSystemRelationName(relname))
885-
elog(ERROR, "class \"%s\" is a system catalog index",
886-
relname);
885+
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -O -P options",
886+
relname);
887887
if (!IsIgnoringSystemIndexes())
888-
elog(ERROR, "class \"%s\" is a system catalog index",
889-
relname);
888+
elog(ERROR, "\"%s\" is a system table. call REINDEX under standalone postgres with -P -O options",
889+
890+
relname);
890891
}
891892
#ifndef NO_SECURITY
892893
if (!pg_ownercheck(userName, relname, RELNAME))
@@ -897,9 +898,9 @@ ProcessUtility(Node *parsetree,
897898
case DATABASE:
898899
relname = (char *) stmt->name;
899900
if (!allowSystemTableMods)
900-
elog(ERROR, "-O option is needed");
901+
elog(ERROR, "must be called under standalone postgres with -O -P options");
901902
if (!IsIgnoringSystemIndexes())
902-
elog(ERROR, "-P option is needed");
903+
elog(ERROR, "must be called under standalone postgres with -P -O options");
903904
ReindexDatabase(relname, stmt->force, false);
904905
break;
905906
}

0 commit comments

Comments
 (0)