MERGE command is not mentioned in the list of commands for variable substitution

Started by PG Bug reporting form6 months ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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.

#2David Rowley
dgrowleyml@gmail.com
In reply to: PG Bug reporting form (#1)
Re: MERGE command is not mentioned in the list of commands for variable substitution

On Tue, 11 Nov 2025 at 05:52, PG Doc comments form
<noreply@postgresql.org> 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:

v1-0001-Doc-include-MERGE-in-variable-substitution-comman.patchapplication/octet-stream; name=v1-0001-Doc-include-MERGE-in-variable-substitution-comman.patchDownload+7-8
#3David Rowley
dgrowleyml@gmail.com
In reply to: David Rowley (#2)
Re: MERGE command is not mentioned in the list of commands for variable substitution

On Tue, 11 Nov 2025 at 10:44, David Rowley <dgrowleyml@gmail.com> 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