Thread: pgsql/src backend/access/heap/heapam.c backend ...

pgsql/src backend/access/heap/heapam.c backend ...

From
tgl@postgresql.org (Tom Lane)
Date:
CVSROOT:    /cvsroot
Module name:    pgsql
Changes by:    tgl@postgresql.org    02/05/21 18:05:55

Modified files:
    src/backend/access/heap: heapam.c tuptoaster.c
    src/backend/access/transam: xact.c
    src/backend/bootstrap: bootstrap.c
    src/backend/catalog: heap.c index.c pg_aggregate.c
                         pg_largeobject.c pg_namespace.c
                         pg_operator.c pg_proc.c pg_type.c
    src/backend/commands: analyze.c async.c cluster.c comment.c
                          copy.c dbcommands.c portalcmds.c
                          proclang.c sequence.c tablecmds.c
                          trigger.c user.c
    src/backend/executor: execMain.c functions.c spi.c
    src/backend/rewrite: rewriteDefine.c
    src/backend/storage/ipc: sinval.c
    src/backend/storage/large_object: inv_api.c
    src/backend/utils/mmgr: portalmem.c
    src/backend/utils/time: tqual.c
    src/include/access: heapam.h xact.h
    src/include/executor: spi_priv.h
    src/include/utils: portal.h tqual.h

Log message:
    Remove global variable scanCommandId in favor of storing a command ID
    in snapshots, per my proposal of a few days ago.  Also, tweak heapam.c
    routines (heap_insert, heap_update, heap_delete, heap_mark4update) to
    be passed the command ID to use, instead of doing GetCurrentCommandID.
    For catalog updates they'll still get passed current command ID, but
    for updates generated from the main executor they'll get passed the
    command ID saved in the snapshot the query is using.  This should fix
    some corner cases associated with functions and triggers that advance
    current command ID while an outer query is still in progress.