pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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-000PaL-ME@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
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/455d254d22665eb7af3b714435f3fecc63696cc7

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(+)



view thread (2+ messages)  latest in thread

Message-ID: <E1oMRtd-000PaL-ME@gemulon.postgresql.org>
Permalink:  ../E1oMRtd-000PaL-ME@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oMRtd-000PaL-ME@gemulon.postgresql.org

 · 

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 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-000PaL-ME@gemulon.postgresql.org>
  References: <E1oMRtd-000PaL-ME@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