1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

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.
This commit is contained in:
Tom Lane
2002-10-14 16:51:30 +00:00
parent 8fc1f413f4
commit 8f2a289d78
5 changed files with 176 additions and 66 deletions

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: trigger.h,v 1.38 2002/09/04 20:31:42 momjian Exp $
* $Id: trigger.h,v 1.39 2002/10/14 16:51:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -112,9 +112,9 @@ extern void renametrig(Oid relid, const char *oldname, const char *newname);
extern void RelationBuildTriggers(Relation relation);
extern void FreeTriggerDesc(TriggerDesc *trigdesc);
extern TriggerDesc *CopyTriggerDesc(TriggerDesc *trigdesc);
extern bool equalTriggerDescs(TriggerDesc *trigdesc1, TriggerDesc *trigdesc2);
extern void FreeTriggerDesc(TriggerDesc *trigdesc);
extern HeapTuple ExecBRInsertTriggers(EState *estate,
ResultRelInfo *relinfo,