mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Remove pg_class.relhaspkey
It is not used for anything internally, and it cannot be relied on for external uses, so it can just be removed. To correct recommended way to check for a primary key is in pg_index. Discussion: https://www.postgresql.org/message-id/flat/b1a24c6c-6913-f89c-674e-0704f0ed69db@2ndquadrant.com
This commit is contained in:
@ -909,16 +909,6 @@ vac_update_relstats(Relation relation,
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have discovered that there are no indexes, then there's no
|
||||
* primary key either. This could be done more thoroughly...
|
||||
*/
|
||||
if (pgcform->relhaspkey && !hasindex)
|
||||
{
|
||||
pgcform->relhaspkey = false;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
/* We also clear relhasrules and relhastriggers if needed */
|
||||
if (pgcform->relhasrules && relation->rd_rules == NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user