Hi Hackers, Here is a fix for finding D13 from [0].
This is a doc-only change. Since UPDATE/DELETE FOR PORTION OF needs UPDATE and/or SELECT permission on the application-time column, we should document that. [0] https://www.postgresql.org/message-id/CA%2BrenyV6QLOJYmLo3gbsg1Y%2BCrho8NqME1jJXgPbO_NgxfBaKQ%40mail.gmail.com Yours, -- Paul ~{:-) [email protected]
From 0beda36f7daab693d243a344b87c0c1362cbf535 Mon Sep 17 00:00:00 2001 From: "Paul A. Jungwirth" <[email protected]> Date: Thu, 3 Sep 2026 12:55:21 -0700 Subject: [PATCH v1] Document the privileges FOR PORTION OF needs on the range column Since UPDATE FOR PORTION OF implicitly updates the application-time column, and since UPDATE/DELETE FOR PORTION OF implicitly reads it, we should mention that UPDATE and/or SELECT permissions are needed for that column when doing an UPDATE/DELETE. Reported-by: Noah Misch <[email protected]> Author: Paul A. Jungwirth <[email protected]> Backpatch-through: 19 --- doc/src/sgml/ref/delete.sgml | 5 ++++- doc/src/sgml/ref/update.sgml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml index 3ab1f60525a..eac221ae292 100644 --- a/doc/src/sgml/ref/delete.sgml +++ b/doc/src/sgml/ref/delete.sgml @@ -94,7 +94,10 @@ DELETE FROM [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * privilege for any table in the <literal>USING</literal> clause or whose values are read in the <replaceable class="parameter">condition</replaceable>. - When <literal>FOR PORTION OF</literal> is used, the secondary inserts do + When <literal>FOR PORTION OF</literal> is used, you must also have the + <literal>SELECT</literal> privilege on the + <replaceable class="parameter">range_column_name</replaceable> column. + The secondary inserts, however, do not require <literal>INSERT</literal> privilege on the table. (This is because conceptually no new information is being added; the inserted rows only preserve existing data about the untargeted time period.) Row-level diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 3175671d475..179b4ae1bfc 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -98,7 +98,10 @@ UPDATE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] privilege on any column whose values are read in the <replaceable class="parameter">expressions</replaceable> or <replaceable class="parameter">condition</replaceable>. - When <literal>FOR PORTION OF</literal> is used, the secondary inserts do + When <literal>FOR PORTION OF</literal> is used, you must also have the + <literal>SELECT</literal> and <literal>UPDATE</literal> privileges on the + <replaceable class="parameter">range_column_name</replaceable> column. + The secondary inserts, however, do not require <literal>INSERT</literal> privilege on the table. (This is because conceptually no new information is being added; the inserted rows only preserve existing data about the untargeted time period.) Row-level -- 2.47.3
