Re: REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Antonin Houska <ah(at)cybertec(dot)at>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table
Date: 2026-09-08 15:58:05
Message-ID: CALj2ACXyTPZEcGeKgHQjtSCScOOLpHNhAdH3Cn2T48aXg2LZfA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Sep 8, 2026 at 5:47 AM Alvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> Thanks, I gave this a look and I think it's okay. I'm not sure about
> the exact wording of the error message though,

Thanks for reviewing it.

> > + ereport(ERROR,
> > + errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> > + errmsg("cannot execute %s on relation \"%s\"",
> > + "REPACK (CONCURRENTLY)", RelationGetRelationName(rel)),
> > + errhint("%s is not supported for tables used as catalog tables.",
> > + "REPACK (CONCURRENTLY)"));
>
> ERROR: cannot execute REPACK (CONCURRENTLY) on relation "foobar"
> HINT: REPACK (CONCURRENTLY) is not supported for tables used as catalog tables.
>
> I think the HINT should really be DETAIL, and I'm not sure we need to
> mention the command again there.
>
> On the other hand, I'm not really
> happy with the term "tables used as catalog tables". In the
> documentation we use the term "user provided catalog tables" or simply
> "user catalog tables" (see <sect2 id="logicaldecoding-capabilities">).
> So how about something like this?
>
> ERROR: cannot execute REPACK (CONCURRENTLY) on relation "foobar"
> DETAIL: This operation is not supported for user catalog tables.

I agree that this is not a hint message. If we ever say something like
"Please do something to get repack to work on user catalog tables,"
that would be a hint, but here we are giving more details about the
error itself. And "user catalog tables" looks good to me too (although
existing error messages around RelationIsUsedAsCatalogTable() uses
table used as a catalog table, with "system catalogs" meaning the
core-provided ones. Also, the proposed wording looks consistent with
errdetail_relkind_not_supported(). So, I used that in the attached
0001.

I agree that this is not a hint message. If we ever say something like
"Please do something to get repack to work on user catalog tables,"
that would be a hint, but here we are giving more details about the
error itself.

"User catalog tables" looks good to me too, although the existing
error messages around RelationIsUsedAsCatalogTable() use "table used
as a catalog table," with "system catalogs" meaning the core-provided
ones.

The proposed wording also looks consistent with
errdetail_relkind_not_supported(). So, I used that in the attached
0001.

That said, I also think we can keep the messaging style consistent
within this function. So, in the attached 0002, I changed the existing
error messages for system catalogs, TOAST tables, non-permanent tables
etc. to use detail messages instead of hints, with consistent wording.

Please find the attached v5 patches.

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v5-0001-Restrict-REPACK-CONCURRENTLY-on-user-catalog-tabl.patch application/octet-stream 4.6 KB
v5-0002-Use-detail-messages-consistently-in-REPACK-CONCUR.patch application/octet-stream 7.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-09-08 15:58:42 Re: Speed up COPY FROM text/CSV parsing using SIMD
Previous Message Ayoub Kazar 2026-09-08 15:48:15 Re: Authorization semantics and candidate pruning in GRAPH_TABLE