pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix new assertion for MERGE view_name ... DO NOTHING.
Date: Sat, 13 Jul 2024 15:11:06 +0000
Message-ID: <E1sSeOw-001Vz9-2g@gemulon.postgresql.org> (raw)

Fix new assertion for MERGE view_name ... DO NOTHING.

Such queries don't expand automatically updatable views, and ModifyTable
uses the wholerow attribute unconditionally.  The user-visible behavior
is fine, so change to more-specific assertions.  Commit
d5f788b41dc2cbdde6e7694c70dda54d829a5ed5 added the wrong assertion.
Back-patch to v17, where commit 5f2e179bd31e5f5803005101eb12a8d7bf8db8f3
introduced MERGE view_name.

Reported by Alexander Lakhin.

Discussion: https://postgr.es/m/e4b40a88-c134-6926-3196-bc4501cb87a2@gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0d3b35c367c21fcfe437b689919bf153f85e2e25

Modified Files
--------------
src/backend/executor/nodeModifyTable.c        | 40 +++++++++++++++------------
src/test/regress/expected/updatable_views.out |  5 ++++
src/test/regress/sql/updatable_views.sql      |  5 ++++
3 files changed, 33 insertions(+), 17 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1sSeOw-001Vz9-2g@gemulon.postgresql.org>
Permalink:  ../E1sSeOw-001Vz9-2g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sSeOw-001Vz9-2g@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix new assertion for MERGE view_name ... DO NOTHING.
  In-Reply-To: <E1sSeOw-001Vz9-2g@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