1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-19 15:49:24 +03:00

Replace pg_class.relhasexclusion with pg_index.indisexclusion.

There isn't any need to track this state on a table-wide basis, and trying
to do so introduces undesirable semantic fuzziness.  Move the flag to
pg_index, where it clearly describes just a single index and can be
immutable after index creation.
This commit is contained in:
Tom Lane
2011-01-25 17:51:59 -05:00
parent 88452d5ba6
commit bd1ad1b019
8 changed files with 52 additions and 77 deletions

View File

@@ -524,21 +524,12 @@ vac_update_relstats(Relation relation,
/*
* If we have discovered that there are no indexes, then there's no
* primary key either, nor any exclusion constraints. This could be done
* more thoroughly...
* primary key either. This could be done more thoroughly...
*/
if (!hasindex)
if (pgcform->relhaspkey && !hasindex)
{
if (pgcform->relhaspkey)
{
pgcform->relhaspkey = false;
dirty = true;
}
if (pgcform->relhasexclusion && pgcform->relkind != RELKIND_INDEX)
{
pgcform->relhasexclusion = false;
dirty = true;
}
pgcform->relhaspkey = false;
dirty = true;
}
/* We also clear relhasrules and relhastriggers if needed */