From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Enforce WITH CHECK OPTION on DELETE FOR PORTION OF leftovers
Date: Fri, 14 Aug 2026 11:54:49 +0000
Message-ID: <E1wuqUq-00000000Xyr-0N2m@gemulon.postgresql.org> (raw)
Enforce WITH CHECK OPTION on DELETE FOR PORTION OF leftovers
DELETE FOR PORTION OF inserts temporal leftovers through ExecInsert(),
but the rewriter only attached view WCOs for INSERT/UPDATE. Leftover
rows could therefore silently escape a WITH CHECK OPTION view, while
the equivalent UPDATE correctly raised an error.
This commit fixes it by attaching the WCOs for FOR PORTION OF deletes
too.
Author: Zsolt Parragi <zsolt.parragi@percona.com>
Co-authored-by: Paul A Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAN4CZFOuTyhGspG0Nyits8PiK2keoNXkLj-u3APzc66aRcWY9A%40mai...
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f3a116a26ff0c0be83b990d3d9b3fd9e425bb197
Modified Files
--------------
doc/src/sgml/ref/create_view.sgml | 20 ++++++----
src/backend/rewrite/rewriteHandler.c | 8 +++-
src/test/regress/expected/updatable_views.out | 56 +++++++++++++++++++++++++++
src/test/regress/sql/updatable_views.sql | 29 ++++++++++++++
4 files changed, 104 insertions(+), 9 deletions(-)
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: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Enforce WITH CHECK OPTION on DELETE FOR PORTION OF leftovers
In-Reply-To: <E1wuqUq-00000000Xyr-0N2m@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