agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Antonin Houska <ah@cybertec.at>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Robert Treat <rob@xzilla.net>
Subject: Re: Adding REPACK [concurrently]
Date: Mon, 20 Apr 2026 09:44:45 +0200
Message-ID: <22189.1776671085@localhost> (raw)
In-Reply-To: <aeJHPNmL4vVy3oPw@pryzbyj2023>
References: <9539.1775724194@localhost>
<fpr4nsmyy3mpfrm2mijspr44dgol2cjeke5tyznb4btsznxsgx@iifdbfe2wl63>
<CADzfLwURKVNQ++Dpi7bjoGfj-8pchDQEVex3eWBx0NCYn6TbDQ@mail.gmail.com>
<rr2hcc5c7cm3xpbi2bniduhvq7pko4fnmykdui2wns2pvowk4n@nod4copoefzs>
<112208.1776173876@localhost>
<aixbxaenmbvsaarnxpagkgajv25zpc4ogo6gwv7lr7bbrh3arp@xom2lyvdgccf>
<25514.1776264611@localhost>
<ikqtl3utsa3er2mfz2oyjv5ofjmlxfhtkolwh5fyfotsmykhqx@rnm3d7e46tjb>
<38385.1776277704@localhost>
<CADzfLwUOnargQe+rpTC5tFUOj+yNj01qJM42PAgi2CiMpZn3tw@mail.gmail.com>
<aeJHPNmL4vVy3oPw@pryzbyj2023>
Justin Pryzby <pryzby@telsasoft.com> wrote:
> I had trouble testing this at first:
>
> postgres=# REPACK (CONCURRENTLY) users;
> ERROR: 42501: permission denied to use replication slots
> DETAIL: Only roles with the REPLICATION attribute may use replication slots.
> CONTEXT: REPACK decoding worker
> LOCATION: CheckSlotPermissions, slot.c:1697
>
> That's surprising, since it was run as a superuser.
>
> It turns out that repack runs as the owner of the table, and the table
> *owner* needs to have REPLICATION -- regardless of who runs the command.
>
> I imagine people have been testing with one user, that both owns the
> table and invokes REPACK. Maybe this just needs to be clarified in the
> documentation/error message?
It was discussed earlier [1] and the concerns about possibly excessive
resource consumptions were addressed by [2]. So I think it the fix was just
forgotten. Attached here.
[1] https://www.postgresql.org/message-id/202603161220.7nv6whwu33hi@alvherre.pgsql
[2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e76d8c749c3152657711ed733f0aea61c0e36...
--
Antonin Houska
Web: https://www.cybertec-postgresql.com
Attachments:
[text/x-diff] 0001-Lock-upgrade-without-deadlocks.patch (0B, ../22189.1776671085@localhost/2-0001-Lock-upgrade-without-deadlocks.patch)
download
view thread (416+ messages) latest in thread
Message-ID: <22189.1776671085@localhost>
Permalink: ../22189.1776671085@localhost/
Also on: postgresql.org/message-id/22189.1776671085@localhost
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-hackers@postgresql.org
Cc: ah@cybertec.at, pryzby@telsasoft.com, mihailnikalayeu@gmail.com, andres@anarazel.de, amit.kapila16@gmail.com, alvherre@alvh.no-ip.org, srinath2133@gmail.com, boekewurm+postgres@gmail.com, rob@xzilla.net
Subject: Re: Adding REPACK [concurrently]
In-Reply-To: <22189.1776671085@localhost>
* 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