public inbox for [email protected]  
help / color / mirror / Atom feed
MERGE command is not mentioned in the list of commands for variable substitution
3+ messages / 2 participants
[nested] [flat]

* MERGE command is not mentioned in the list of commands for variable substitution
@ 2025-11-10 14:29  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Doc comments form @ 2025-11-10 14:29 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/plpgsql-implementation.html
Description:

In the last paragraph of the section 41.11.1. "Variable Substitution" there
is such a sentence --
"Variable substitution currently works only in SELECT, INSERT, UPDATE,
DELETE, and commands containing one of these..."
https://www.postgresql.org/docs/current/plpgsql-implementation.html#PLPGSQL-VAR-SUBST
But experiments showed that variable substitution works for MERGE command
too.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: MERGE command is not mentioned in the list of commands for variable substitution
@ 2025-11-10 21:44  David Rowley <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: David Rowley @ 2025-11-10 21:44 UTC (permalink / raw)
  To: [email protected]; [email protected]

On Tue, 11 Nov 2025 at 05:52, PG Doc comments form
<[email protected]> wrote:
> "Variable substitution currently works only in SELECT, INSERT, UPDATE,
> DELETE, and commands containing one of these..."
> https://www.postgresql.org/docs/current/plpgsql-implementation.html#PLPGSQL-VAR-SUBST
> But experiments showed that variable substitution works for MERGE command
> too.

Thanks for the report. You're right that this has been overlooked.

The attached patch fixes it. I can take care of this once the back
branches are open again after the minor releases are out.

David


Attachments:

  [application/octet-stream] v1-0001-Doc-include-MERGE-in-variable-substitution-comman.patch (1.8K, 2-v1-0001-Doc-include-MERGE-in-variable-substitution-comman.patch)
  download | inline diff:
From 313853cc67de66e76d50854fb6b5218d49c53fc1 Mon Sep 17 00:00:00 2001
From: David Rowley <[email protected]>
Date: Tue, 11 Nov 2025 10:35:06 +1300
Subject: [PATCH v1] Doc: include MERGE in variable substitution command list

Author: David Rowley <[email protected]>
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
---
 doc/src/sgml/plpgsql.sgml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index b561b4cc580..561f6e50d63 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -4962,13 +4962,13 @@ $$ LANGUAGE plpgsql;
    <para>
     Variable substitution currently works only in <command>SELECT</command>,
     <command>INSERT</command>, <command>UPDATE</command>,
-    <command>DELETE</command>, and commands containing one of
-    these (such as <command>EXPLAIN</command> and <command>CREATE TABLE
-    ... AS SELECT</command>),
-    because the main SQL engine allows query parameters only in these
-    commands.  To use a non-constant name or value in other statement
-    types (generically called utility statements), you must construct
-    the utility statement as a string and <command>EXECUTE</command> it.
+    <command>DELETE</command>, <command>MERGE</command> and commands
+    containing one of these (such as <command>EXPLAIN</command> and
+    <command>CREATE TABLE ... AS SELECT</command>), because the main SQL
+    engine allows query parameters only in these commands.  To use a
+    non-constant name or value in other statement types (generically called
+    utility statements), you must construct the utility statement as a string
+    and <command>EXECUTE</command> it.
    </para>
 
   </sect2>
-- 
2.40.1.windows.1



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: MERGE command is not mentioned in the list of commands for variable substitution
@ 2025-11-16 21:53  David Rowley <[email protected]>
  parent: David Rowley <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: David Rowley @ 2025-11-16 21:53 UTC (permalink / raw)
  To: [email protected]; [email protected]

On Tue, 11 Nov 2025 at 10:44, David Rowley <[email protected]> wrote:
> The attached patch fixes it. I can take care of this once the back
> branches are open again after the minor releases are out.

Pushed.

David






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-11-16 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-10 14:29 MERGE command is not mentioned in the list of commands for variable substitution PG Doc comments form <[email protected]>
2025-11-10 21:44 ` David Rowley <[email protected]>
2025-11-16 21:53   ` David Rowley <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox