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:48:29 -0500 |
| commit | 39b5e5f3370258cae843e8cc83eccd59ddb532dd (patch) | |
| tree | 54a4bcee6167e5051a32bd634e9da668ca760c8a /src/backend/commands/indexcmds.c | |
| parent | ba3afc88d2b81fc609cda8504ee7b54c54b379d7 (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 780dbc23ede..a129511128b 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -1634,7 +1634,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))); @@ -1747,7 +1747,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)), |
