aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.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/commands/copy.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/commands/copy.c')
-rw-r--r--src/backend/commands/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index b4de718eae9..2bf0c095809 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.175 2002/09/20 16:56:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.176 2002/10/14 16:51:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -780,7 +780,7 @@ CopyFrom(Relation rel, List *attnumlist, bool binary, bool oids,
resultRelInfo = makeNode(ResultRelInfo);
resultRelInfo->ri_RangeTableIndex = 1; /* dummy */
resultRelInfo->ri_RelationDesc = rel;
- resultRelInfo->ri_TrigDesc = rel->trigdesc;
+ resultRelInfo->ri_TrigDesc = CopyTriggerDesc(rel->trigdesc);
ExecOpenIndices(resultRelInfo);