REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: alvherre(at)kurilemu(dot)de
Subject: REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table
Date: 2026-08-27 14:22:13
Message-ID: apBIFWzHYOaG0auN@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

IIUC this can cause problems for logical replication consumers, since the
CONCURRENTLY path doesn't go through the rewriteheap.c machinery like the
non-concurrent path does:

CREATE TABLE t (a INT PRIMARY KEY, b TEXT) WITH (user_catalog_table = true);
ALTER TABLE t ALTER COLUMN b TYPE varchar(100); -- correctly fails
REPACK (CONCURRENTLY) t; -- should fail but doesn't

I believe the fix for v19 is to add a check for
RelationIsUsedAsCatalogTable() in check_concurrent_repack_requirements()
(plus a corresponding update to the list of CONCURRENTLY limitations in the
docs).

--
nathan

Browse pgsql-hackers by date

  From Date Subject
Next Message Osama Abdul Qader 2026-08-27 14:23:39 Re: REPACK (ANALYZE) within transaction block segfaults
Previous Message Nathan Bossart 2026-08-27 13:56:34 REPACK (ANALYZE) within transaction block segfaults