1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Replace pg_class.reltriggers with relhastriggers, which is just a boolean hint

("there might be triggers") rather than an exact count.  This is necessary
catalog infrastructure for the upcoming patch to reduce the strength of
locking needed for trigger addition/removal.  Split out and committed
separately for ease of reviewing/testing.

In passing, also get rid of the unused pg_class columns relukeys, relfkeys,
and relrefs, which haven't been maintained in many years and now have no
chance of ever being maintained (because of wishing to avoid locking).

Simon Riggs
This commit is contained in:
Tom Lane
2008-11-09 21:24:33 +00:00
parent 1d577f5e49
commit e4718f2c9e
13 changed files with 162 additions and 197 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.274 2008/09/30 10:52:13 heikki Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.275 2008/11/09 21:24:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -856,7 +856,7 @@ RelationBuildDesc(Oid targetRelId, Relation oldrelation)
relation->rd_rulescxt = NULL;
}
if (relation->rd_rel->reltriggers > 0)
if (relation->rd_rel->relhastriggers)
RelationBuildTriggers(relation);
else
relation->trigdesc = NULL;
@ -2641,7 +2641,7 @@ RelationCacheInitializePhase2(void)
*/
if (relation->rd_rel->relhasrules && relation->rd_rules == NULL)
RelationBuildRuleLock(relation);
if (relation->rd_rel->reltriggers > 0 && relation->trigdesc == NULL)
if (relation->rd_rel->relhastriggers && relation->trigdesc == NULL)
RelationBuildTriggers(relation);
}