pgsql: Remove p_is_insert from struct ParseState.

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove p_is_insert from struct ParseState.
Date: 2026-02-12 09:07:18
Message-ID: E1vqSfN-000LwX-05@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove p_is_insert from struct ParseState.

The only place that used p_is_insert was transformAssignedExpr(),
which used it to distinguish INSERT from UPDATE when handling
indirection on assignment target columns -- see commit c1ca3a19df3.
However, this information is already available to
transformAssignedExpr() via its exprKind parameter, which is always
either EXPR_KIND_INSERT_TARGET or EXPR_KIND_UPDATE_TARGET.

As noted in the commit message for c1ca3a19df3, this use of
p_is_insert isn't particularly pretty, so have transformAssignedExpr()
use the exprKind parameter instead. This then allows p_is_insert to be
removed entirely, which simplifies state management in a few other
places across the parser.

Author: Viktor Holmberg <v(at)viktorh(dot)net>
Reviewed-by: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Discussion: https://postgr.es/m/badc3b4c-da73-4000-b8d3-638a6f53a769@Spark

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/706cadde3239842a41a3375d50dda8b33325c008

Modified Files
--------------
src/backend/parser/analyze.c | 9 ---------
src/backend/parser/parse_merge.c | 11 +++--------
src/backend/parser/parse_target.c | 6 ++++--
src/include/parser/parse_node.h | 5 -----
4 files changed, 7 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2026-02-12 09:15:25 pgsql: Refactor slot synchronization logic in slotsync.c.
Previous Message Richard Guo 2026-02-12 06:31:07 pgsql: Reduce LEFT JOIN to ANTI JOIN using NOT NULL constraints