Thread: pgsql-server/src backend/commands/copy.c backe ...

pgsql-server/src backend/commands/copy.c backe ...

From
tgl@postgresql.org (Tom Lane)
Date:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    tgl@postgresql.org    02/10/14 12:51:30

Modified files:
    src/backend/commands: copy.c trigger.c
    src/backend/executor: execMain.c
    src/backend/utils/cache: relcache.c
    src/include/commands: trigger.h

Log message:
    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.