pgsql: Require UPDATE permission on FOR PORTION OF column

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Require UPDATE permission on FOR PORTION OF column
Date: 2026-06-04 09:53:20
Message-ID: E1wV4lM-0011Pe-3B@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Require UPDATE permission on FOR PORTION OF column

It seems like the SQL standard does require this after all, and it
makes sense because these columns get changed. (This is not to be
confused with *not* requiring INSERT permission to add the temporal
leftovers.)

Adding the column to RTEPermissionInfo->updatedCols also fixes a
couple outstanding bugs from other (non-permission) features using
that bitmapset to detect changes: GENERATED columns and UPDATE OF
triggers. This patch includes test cases to exercise those scenarios,
including on partitioned tables.

Author: Paul A. Jungwirth <pj(at)illuminatedcomputing(dot)com>
Reviewed-by: jian he <jian(dot)universality(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/CAHg%2BQDcd%3Dt69gLf9yQexO07EJ2mx0Z70NFHo6h94X1EDA%3DhM0g%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/parser/analyze.c | 12 +-
src/test/regress/expected/for_portion_of.out | 190 ++++++++++++++++++++-------
src/test/regress/expected/privileges.out | 12 +-
src/test/regress/sql/for_portion_of.sql | 76 ++++++++++-
src/test/regress/sql/privileges.sql | 10 +-
5 files changed, 241 insertions(+), 59 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-06-04 10:04:07 pgsql: Small terminology fixes in comments
Previous Message Peter Eisentraut 2026-06-04 09:17:40 pgsql: Fix cross-leftover pollution in FOR PORTION OF insert triggers