public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nisha Moond <[email protected]>
To: PostgreSQL Hackers <[email protected]>
To: Fujii Masao <[email protected]>
Subject: Fix column privileges for pg_subscription.subwalrcvtimeout
Date: Mon, 1 Jun 2026 19:14:12 +0530
Message-ID: <CABdArM4uA=6nA0BunJwudiEoY1BcWUS_oj_2pkEq_d-YdiBJhw@mail.gmail.com> (raw)
Hi Hackers,
IIUC, all columns of pg_subscription, except subconninfo, are intended
to be readable by non-superusers as well. A comment in
system_views.sql also states:
"-- All columns of pg_subscription except subconninfo are publicly readable."
However, 'subwalrcvtimeout' is currently not accessible:
Test:
postgres=# CREATE ROLE nisha LOGIN PASSWORD 'testpass';
CREATE ROLE
postgres=# SET SESSION AUTHORIZATION nisha;
SET
postgres=> select subwalrcvtimeout from pg_subscription;
ERROR: permission denied for table pg_subscription
It appears the column-level privileges for pg_subscription were not
updated when subwalrcvtimeout was added.
Attached is a small fix patch to grant public access to this column,
consistent with the existing behavior of the other pg_subscription
columns.
CC: Fujii-san (subwalrcvtimeout was introduced by commit fb80f38).
--
Thanks,
Nisha
Attachments:
[application/octet-stream] v1-0001-Fix-pg_subscription-column-privileges-for-subwalr.patch (1.4K, 2-v1-0001-Fix-pg_subscription-column-privileges-for-subwalr.patch)
download | inline diff:
From c0329c344d4be52f0c931fd13ac3e1a02c13cd7a Mon Sep 17 00:00:00 2001
From: Nisha Moond <[email protected]>
Date: Mon, 1 Jun 2026 18:43:42 +0530
Subject: [PATCH v1] Fix pg_subscription column privileges for subwalrcvtimeout
The subwalrcvtimeout column was added by commit fb80f38, but the
column-level privileges on pg_subscription were not updated. As a
result, non-superusers cannot read the column, unlike the other
publicly readable pg_subscription columns.
This patch grant SELECT privilege on subwalrcvtimeout to PUBLIC.
---
src/backend/catalog/system_views.sql | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 73a1c1c4670..8f129baec90 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1527,7 +1527,8 @@ GRANT SELECT (oid, subdbid, subskiplsn, subname, subowner, subenabled,
subbinary, substream, subtwophasestate, subdisableonerr,
subpasswordrequired, subrunasowner, subfailover,
subretaindeadtuples, submaxretention, subretentionactive,
- subserver, subslotname, subsynccommit, subpublications, suborigin)
+ subserver, subslotname, subsynccommit, subwalrcvtimeout,
+ subpublications, suborigin)
ON pg_subscription TO public;
CREATE VIEW pg_stat_subscription_stats AS
--
2.50.1 (Apple Git-155)
view thread (7+ messages) latest in thread
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Fix column privileges for pg_subscription.subwalrcvtimeout
In-Reply-To: <CABdArM4uA=6nA0BunJwudiEoY1BcWUS_oj_2pkEq_d-YdiBJhw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox