pgsql: Restrict REPACK (CONCURRENTLY) on user catalog tables.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Restrict REPACK (CONCURRENTLY) on user catalog tables.
Date: 2026-09-08 20:06:18
Message-ID: E1x425B-000000042Kp-3cma@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Restrict REPACK (CONCURRENTLY) on user catalog tables.

REPACK (CONCURRENTLY) is not an MVCC-safe operation; it doesn't
preserve the visibility information, which logical decoding needs
because it reads user catalog tables under a historic snapshot.

Disallow REPACK (CONCURRENTLY) on user catalog tables. Removing this
check requires making it MVCC-safe and logical rewrite mappings.

Backpatch to v19, where REPACK (CONCURRENTLY) was introduced.

Reported-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Author: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Reviewed-by: Antonin Houska <ah(at)cybertec(dot)at>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Reviewed-by: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
Discussion: https://postgr.es/m/apBIFWzHYOaG0auN%40nathan
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/86f7c82cf1023e3599f40f939727791a7090cd44

Modified Files
--------------
contrib/test_decoding/expected/repack.out | 6 ++++++
contrib/test_decoding/sql/repack.sql | 5 +++++
doc/src/sgml/ref/repack.sgml | 8 ++++++++
src/backend/commands/repack.c | 13 +++++++++++++
4 files changed, 32 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-09-08 20:06:23 pgsql: Restrict REPACK (CONCURRENTLY) on user catalog tables.
Previous Message Masahiko Sawada 2026-09-08 19:06:47 pgsql: Fix REPACK (CONCURRENTLY) when the table owner lacks CONNECT.