mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Add exclusion constraints, which generalize the concept of uniqueness to
support any indexable commutative operator, not just equality. Two rows violate the exclusion constraint if "row1.col OP row2.col" is TRUE for each of the columns in the constraint. Jeff Davis, reviewed by Robert Haas
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.396 2009/11/16 21:32:06 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.397 2009/12/07 05:22:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -763,7 +763,8 @@ vac_update_relstats(Relation relation,
|
||||
|
||||
/*
|
||||
* If we have discovered that there are no indexes, then there's no
|
||||
* primary key either. This could be done more thoroughly...
|
||||
* primary key either, nor any exclusion constraints. This could be done
|
||||
* more thoroughly...
|
||||
*/
|
||||
if (!hasindex)
|
||||
{
|
||||
@@ -772,6 +773,11 @@ vac_update_relstats(Relation relation,
|
||||
pgcform->relhaspkey = false;
|
||||
dirty = true;
|
||||
}
|
||||
if (pgcform->relhasexclusion && pgcform->relkind != RELKIND_INDEX)
|
||||
{
|
||||
pgcform->relhasexclusion = false;
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* We also clear relhasrules and relhastriggers if needed */
|
||||
|
Reference in New Issue
Block a user