pgsql: Fix FOR PORTION OF with non-updatable view columns

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix FOR PORTION OF with non-updatable view columns
Date: 2026-05-13 11:51:40
Message-ID: E1wN87o-000Kp2-0u@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix FOR PORTION OF with non-updatable view columns

Both UPDATE and DELETE were failing to test that the application-time
column was updatable. The column is not part of
perminfo->updatedCols, because it should not be checked for
permissions. And it needs to be checked in the DELETE case as well,
since we might insert leftovers with a value for that column.

Author: Paul A. Jungwirth <pj(at)illuminatedcomputing(dot)com>
Co-authored-by: jian he <jian(dot)universality(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CACJufxFRqg8%3DgbZ-Q6ZS_UQ%2BYdwfZpk%2B9rf7jgWrk8m4RMUm%3DA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7ca8c9429675b34600e679525da6b5280c1cafa5

Modified Files
--------------
src/backend/rewrite/rewriteHandler.c | 47 +++++++++++++++++++++++++++
src/test/regress/expected/updatable_views.out | 14 ++++++++
src/test/regress/sql/updatable_views.sql | 11 +++++++
3 files changed, 72 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-05-13 14:11:56 pgsql: pgindent: Fix spacing after != when member name matches typedef.
Previous Message Michael Paquier 2026-05-13 06:48:43 pgsql: pg_stat_statements: Set PlannedStmt to NULL after nested utility