From e4718f2c9eff30dedd022fac53a1f874aa1955d8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 9 Nov 2008 21:24:33 +0000 Subject: 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 --- src/backend/utils/cache/relcache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/cache/relcache.c') diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index cec75ada720..92adfd8300d 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -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); } -- cgit v1.2.3