pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: pgsql-hackers@postgresql.org
Cc: alvherre@kurilemu.de
Subject: REPACK (CONCURRENTLY) fails when table owner lacks CONNECT
Date: Thu, 27 Aug 2026 10:46:20 -0500
Message-ID: <apBbzFd_EYAfHV45@nathan> (raw)

The REPACK decoding worker doesn't pass BGWORKER_BYPASS_ALLOWCONN like
parallel.c does, so it can fail to start.  Here is a reproducer:

    CREATE DATABASE d;
    REVOKE CONNECT ON DATABASE d FROM PUBLIC;
    \c d
    CREATE ROLE r NOLOGIN;
    CREATE TABLE t (a INT PRIMARY KEY);
    ALTER TABLE t OWNER TO r;
    REPACK t; -- works
    REPACK (CONCURRENTLY) t; -- fails

That last command produces the following output:

    ERROR:  permission denied for database "d"
    DETAIL:  User does not have CONNECT privilege.
    CONTEXT:  REPACK decoding worker

This one seems easy enough to fix.

-- 
nathan






view thread (12+ messages)  latest in thread

Message-ID: <apBbzFd_EYAfHV45@nathan>
Permalink:  ../apBbzFd_EYAfHV45@nathan/
Also on:    postgresql.org/message-id/apBbzFd_EYAfHV45@nathan

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, alvherre@kurilemu.de
  Subject: Re: REPACK (CONCURRENTLY) fails when table owner lacks CONNECT
  In-Reply-To: <apBbzFd_EYAfHV45@nathan>
  References: <apBbzFd_EYAfHV45@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox