]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Require UPDATE permission on FOR PORTION OF column
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Jun 2026 09:30:41 +0000 (11:30 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Jun 2026 09:48:35 +0000 (11:48 +0200)
commit7ac030d5b152475275e84e0abe0b3628700fbeda
tree269378bf76a33f4d3e23b1664c055db61cb933da
parent993a7aa0e4af0922ac86d8914e0e78fc38fb0daf
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@illuminatedcomputing.com>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAHg%2BQDcd%3Dt69gLf9yQexO07EJ2mx0Z70NFHo6h94X1EDA%3DhM0g%40mail.gmail.com
src/backend/parser/analyze.c
src/test/regress/expected/for_portion_of.out
src/test/regress/expected/privileges.out
src/test/regress/sql/for_portion_of.sql
src/test/regress/sql/privileges.sql