Split ExecUpdate and ExecDelete into reusable pieces

Create subroutines ExecUpdatePrologue / ExecUpdateAct /
ExecUpdateEpilogue, and similar for ExecDelete.

Introduce a new struct to be used internally in nodeModifyTable.c,
dubbed ModifyTableContext, which contains all context information needed
to perform these operations, as well as ExecInsert and others.

This allows using a different schedule and a different way of evaluating
the results of these operations, which can be exploited by a later
commit introducing support for MERGE.  It also makes ExecUpdate and
ExecDelete proper shorter and (hopefully) simpler.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Discussion: https://postgr.es/m/202202271724.4z7xv3cf46kv@alvherre.pgsql
pull/81/head
Alvaro Herrera 3 years ago
parent f2553d4306
commit 25e777cf8e
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE
  1. 781
      src/backend/executor/nodeModifyTable.c
  2. 2
      src/tools/pgindent/typedefs.list

File diff suppressed because it is too large Load Diff

@ -1460,6 +1460,7 @@ MinimalTupleTableSlot
MinmaxMultiOpaque
MinmaxOpaque
ModifyTable
ModifyTableContext
ModifyTablePath
ModifyTableState
MorphOpaque
@ -2793,6 +2794,7 @@ UnlistenStmt
UnpackTarState
UnresolvedTup
UnresolvedTupData
UpdateContext
UpdateStmt
UpperRelationKind
UpperUniquePath

Loading…
Cancel
Save