[PATCH] Misleading error message for REPACK USING INDEX on shared catalogs

From: Devrim Gündüz <devrim(at)gunduz(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Misleading error message for REPACK USING INDEX on shared catalogs
Date: 2026-09-22 22:05:12
Message-ID: 4dbba6c413bad017217bfcace43a0f33fc921eb2.camel@gunduz.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While poking at REPACK on v19 beta4 for my Chicago meetup talk, I
noticed that the error message emitted when trying to REPACK a shared
catalog with USING INDEX is misleading, since it makes it sound like
REPACK itself is disallowed on shared catalogs, when only the USING
INDEX form is:

postgres=# REPACK pg_authid USING INDEX pg_authid_oid_index;
ERROR: cannot execute REPACK on a shared catalog

postgres=# REPACK pg_authid;
REPACK

The restriction is intentional in repack.c, but the errmsg() text
doesn't convey that the restriction is specific to the USING INDEX form,
so for a while I thought I found a bug.

Attached patch tweaks the message to name USING INDEX specifically,
and also includes the related comment in repack.c to an errdetail() so
it's visible to the user, not just to someone reading the source:

ERROR: cannot execute REPACK USING INDEX on a shared catalog
DETAIL: Marking an index as clustered on a shared catalog would
only take effect in the current database.

Regards,
--
Devrim Gündüz
Open Source Solution Architect, PostgreSQL Major Contributor
BlueSky: @devrim.gunduz.org , @gunduz.org

Attachment Content-Type Size
repack_shared_catalog_errmsg.patch text/x-patch 620 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-09-22 22:18:08 Re: SSI: ON CONFLICT DO SELECT takes no predicate lock on the returned row
Previous Message Daniel Gustafsson 2026-09-22 21:55:36 Re: Serverside SNI support in libpq