agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix REPACK (CONCURRENTLY) when the table owner lacks CONNECT.
Date: Tue, 08 Sep 2026 19:06:47 +0000
Message-ID: <E1x419a-00000004202-0S6E@gemulon.postgresql.org> (raw)
Fix REPACK (CONCURRENTLY) when the table owner lacks CONNECT.
REPACK (CONCURRENTLY) launches a background worker to decode changes
made while the table is being rewritten. The worker connects as the
table owner but bypassed the LOGIN check only, so CONNECT was still
checked against a role that need not have it, and the command could
fail with "permission denied for database".
Pass BGWORKER_BYPASS_ALLOWCONN as well, as we do for parallel
workers. That is safe because the leader already checked the invoking
user's privileges on the table before starting the worker.
Reported-by: Nathan Bossart <nathandbossart@gmail.com>
Author: Matheus Alcantara <mths.dev@pm.me>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/apBbzFd_EYAfHV45@nathan
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/9bf3a414560d93ef8e8cf61748cd5783ab4bc9f9
Modified Files
--------------
src/backend/commands/repack_worker.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
view thread (2+ messages)
Message-ID: <E1x419a-00000004202-0S6E@gemulon.postgresql.org>
Permalink: ../E1x419a-00000004202-0S6E@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1x419a-00000004202-0S6E@gemulon.postgresql.org
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: pgsql-committers@postgresql.org
Cc: msawada@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix REPACK (CONCURRENTLY) when the table owner lacks CONNECT.
In-Reply-To: <E1x419a-00000004202-0S6E@gemulon.postgresql.org>
* 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