Remove p_is_insert from struct ParseState.
Dean Rasheed <dean.a.rasheed@gmail.com>
Author:
Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2026-02-12T09:01:42Z
Releases:
19 (unreleased)
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@viktorh.net> Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com> Discussion: https://postgr.es/m/badc3b4c-da73-4000-b8d3-638a6f53a769@Spark
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/analyze.c | modified | +0 −9 |
| src/backend/parser/parse_merge.c | modified | +3 −8 |
| src/backend/parser/parse_target.c | modified | +4 −2 |
| src/include/parser/parse_node.h | modified | +0 −5 |
Discussion
- ON CONFLICT DO SELECT (take 3) 45 messages · 2025-10-07 → 2026-02-12