Re: Adding REPACK [concurrently]

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Antonin Houska <ah(at)cybertec(dot)at>, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>, Robert Treat <rob(at)xzilla(dot)net>
Subject: Re: Adding REPACK [concurrently]
Date: 2025-11-05 02:48:21
Message-ID: CACJufxFPiasoUXFR4SK2QRq6mnztiX=3F82=8PyBrdocX5awBw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 31, 2025 at 7:17 AM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> Hello,
>
> Here's a new installment of this series, v25, including the CONCURRENTLY
> part, which required some conflict fixes on top of the much-changed
> v24-0001 patch.
>

<refnamediv>
<refname>pg_repackdb</refname>
<refpurpose>repack and analyze a <productname>PostgreSQL</productname>
database</refpurpose>
</refnamediv>

but with --all option specified, it's doing repack whole cluster.
(more than one database).
I am not fully sure this description is OK.

I think pg_repackdb Synopsis section:
pg_repackdb [connection-option...] [option...] [ -t | --table table [(
column [,...] )] ] ... [ dbname | -a | --all ]
pg_repackdb [connection-option...] [option...] [ -n | --schema schema
] ... [ dbname | -a | --all ]
pg_repackdb [connection-option...] [option...] [ -N | --exclude-schema
schema ] ... [ dbname | -a | --all ]

can be simplified the same way as as pg_dump:

pg_repackdb [connection-option...] [option...] [ dbname | -a | --all ]

------------------------
[-d] dbname
[--dbname=]dbname

what do you think to expand it as below:
dbname
-d dbname
--dbname=dbname
--------------------

+ printf(_(" --index[=INDEX] repack following an index\n"));
should it be
+ printf(_("--index[=INDEX] repack following an index\n"));
?

similar to pg_dump:
printf(_("\nIf no database name is supplied, then the PGDATABASE
environment\n"
"variable value is used.\n\n"));

in pg_repackdb help section, we can mention:
printf(_("\nIf no database name is supplied and --all option not
specified then the PGDATABASE environment\n"
"variable value is used.\n\n"));
Do you think it's necessary?

what the expectation of
pg_repackdb --index=index_name, the doc is not very helpful.

pg_repackdb --analyze --index=zz --verbose
pg_repackdb: repacking database "src3"
pg_repackdb: error: processing of database "src3" failed: ERROR: "zz"
is not an index for table "tenk1"

select pg_get_indexdef ('zz'::regclass);
pg_get_indexdef
---------------------------------------------------
CREATE INDEX zz ON public.tenk2 USING btree (two)

------
jian he
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-11-05 03:02:22 Re: Extend injection_points_attach() to accept a user-defined function
Previous Message Thomas Munro 2025-11-05 01:50:55 Re: meson's in-tree libpq header search order vs -Dextra_include_dirs