diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-01-20 22:44:10 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-01-20 22:44:10 -0500 |
commit | 8ceb24568054232696dddc1166a8563bc78c900a (patch) | |
tree | a9921588da9066933ddf723e79345471909de5e5 /src/backend/commands/indexcmds.c | |
parent | 14b9f69cb2077c65a09df78d167d45c35b1d7973 (diff) |
Make ALTER TABLE revalidate uniqueness and exclusion constraints.
Failure to do so can lead to constraint violations. This was broken by
commit 1ddc2703a936d03953657f43345460b9242bbed1 on 2010-02-07, so
back-patch to 9.0.
Noah Misch. Regression test by me.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index f809a26369e..7a6a4c33adc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -1629,7 +1629,7 @@ ReindexTable(RangeVar *relation) ReleaseSysCache(tuple); - if (!reindex_relation(heapOid, true, false)) + if (!reindex_relation(heapOid, true, 0)) ereport(NOTICE, (errmsg("table \"%s\" has no indexes", relation->relname))); @@ -1742,7 +1742,7 @@ ReindexDatabase(const char *databaseName, bool do_system, bool do_user) StartTransactionCommand(); /* functions in indexes may want a snapshot set */ PushActiveSnapshot(GetTransactionSnapshot()); - if (reindex_relation(relid, true, false)) + if (reindex_relation(relid, true, 0)) ereport(NOTICE, (errmsg("table \"%s.%s\" was reindexed", get_namespace_name(get_rel_namespace(relid)), |