From: Dean Rasheed Date: Tue, 4 Jun 2024 08:29:42 +0000 (+0100) Subject: Fix another couple of outdated comments for MERGE RETURNING. X-Git-Tag: REL_17_BETA2~100 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=5c5bccef211cfc98e0d6c4bc1af40a33c8ac2488;p=postgresql.git Fix another couple of outdated comments for MERGE RETURNING. Oversights in c649fa24a4 which added RETURNING support to MERGE. Discussion: https://postgr.es/m/CAApHDvpqp6vtUzG-_josUEiBGyqnrnVxJ-VdF+hJLXjHdHzsyQ@mail.gmail.com --- diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 9618619762b..653685bffc5 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -6016,7 +6016,7 @@ get_basic_select_query(Query *query, deparse_context *context, /* ---------- * get_target_list - Parse back a SELECT target list * - * This is also used for RETURNING lists in INSERT/UPDATE/DELETE. + * This is also used for RETURNING lists in INSERT/UPDATE/DELETE/MERGE. * * resultDesc and colNamesVisible are as for get_query_def() * ---------- diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index ddfed02db22..85a62b538e5 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -154,7 +154,7 @@ typedef struct Query bool hasDistinctOn pg_node_attr(query_jumble_ignore); /* WITH RECURSIVE was specified */ bool hasRecursive pg_node_attr(query_jumble_ignore); - /* has INSERT/UPDATE/DELETE in WITH */ + /* has INSERT/UPDATE/DELETE/MERGE in WITH */ bool hasModifyingCTE pg_node_attr(query_jumble_ignore); /* FOR [KEY] UPDATE/SHARE was specified */ bool hasForUpdate pg_node_attr(query_jumble_ignore); diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h index 535928613f1..11419faecaa 100644 --- a/src/include/utils/portal.h +++ b/src/include/utils/portal.h @@ -64,9 +64,9 @@ * supports holdable cursors (the Executor results can be dumped into a * tuplestore for access after transaction completion). * - * PORTAL_ONE_RETURNING: the portal contains a single INSERT/UPDATE/DELETE - * query with a RETURNING clause (plus possibly auxiliary queries added by - * rule rewriting). On first execution, we run the portal to completion + * PORTAL_ONE_RETURNING: the portal contains a single INSERT/UPDATE/DELETE/ + * MERGE query with a RETURNING clause (plus possibly auxiliary queries added + * by rule rewriting). On first execution, we run the portal to completion * and dump the primary query's results into the portal tuplestore; the * results are then returned to the client as demanded. (We can't support * suspension of the query partway through, because the AFTER TRIGGER code