public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Rowley <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: MERGE command is not mentioned in the list of commands for variable substitution
Date: Tue, 11 Nov 2025 10:44:36 +1300
Message-ID: <CAApHDvqCWEWL3QtOr+ebCXmCu0asLTcxTVhOwBWtY_N3zx+A6w@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[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
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: MERGE command is not mentioned in the list of commands for variable substitution
In-Reply-To: <CAApHDvqCWEWL3QtOr+ebCXmCu0asLTcxTVhOwBWtY_N3zx+A6w@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox