From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reject MERGE in CTEs and COPY
Date: Fri, 12 Aug 2022 10:28:06 +0000
Message-ID: <E1oMRtd-000PaK-Lj@gemulon.postgresql.org> (raw)
Reject MERGE in CTEs and COPY
The grammar added for MERGE inadvertently made it accepted syntax in
places that were not prepared to deal with it -- namely COPY and inside
CTEs, but invoking these things with MERGE currently causes assertion
failures or weird misbehavior in non-assertion builds. Protect those
places by checking for it explicitly until somebody decides to implement
it.
Reported-by: Alexey Borzov <borz_off@cs.msu.su>
Discussion: https://postgr.es/m/17579-82482cd7b267b862@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/92af9143f13df8c54362ebbd4397cb53f207ff2d
Modified Files
--------------
src/backend/commands/copy.c | 6 ++++++
src/backend/parser/parse_cte.c | 7 +++++++
src/test/regress/expected/merge.out | 14 ++++++++++++++
src/test/regress/sql/merge.sql | 10 ++++++++++
4 files changed, 37 insertions(+)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Reject MERGE in CTEs and COPY
In-Reply-To: <E1oMRtd-000PaK-Lj@gemulon.postgresql.org>
References: <E1oMRtd-000PaK-Lj@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox