aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-10-14 16:51:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-10-14 16:51:30 +0000
commit8f2a289d78a0f12ec82be77d56947cf383ee58dd (patch)
tree756f492635939109fdbda2b56de558db0d840819 /src/backend/executor/execMain.c
parent8fc1f413f41242df1b9060670af8d2352a0e93b0 (diff)
downloadpostgresql-8f2a289d78a0f12ec82be77d56947cf383ee58dd.tar.gz
postgresql-8f2a289d78a0f12ec82be77d56947cf383ee58dd.zip
Arrange to copy relcache's trigdesc structure at the start of any
query that uses it. This ensures that triggers will be applied consistently throughout a query even if someone commits changes to the relation's pg_class.reltriggers field meanwhile. Per crash report from Laurette Cisneros. While at it, simplify memory management in relcache.c, which no longer needs the old hack to try to keep trigger info in the same place over a relcache entry rebuild. (Should try to fix rd_att and rewrite-rule access similarly, someday.) And make RelationBuildTriggers simpler and more robust by making it build the trigdesc in working memory and then CopyTriggerDesc() into cache memory.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 370d7e52ec3..c94767926d2 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -27,7 +27,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.179 2002/09/23 22:57:44 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.180 2002/10/14 16:51:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -799,7 +799,8 @@ initResultRelInfo(ResultRelInfo *resultRelInfo,
resultRelInfo->ri_NumIndices = 0;
resultRelInfo->ri_IndexRelationDescs = NULL;
resultRelInfo->ri_IndexRelationInfo = NULL;
- resultRelInfo->ri_TrigDesc = resultRelationDesc->trigdesc;
+ /* make a copy so as not to depend on relcache info not changing... */
+ resultRelInfo->ri_TrigDesc = CopyTriggerDesc(resultRelationDesc->trigdesc);
resultRelInfo->ri_TrigFunctions = NULL;
resultRelInfo->ri_ConstraintExprs = NULL;
resultRelInfo->ri_junkFilter = NULL;