Re: Adding REPACK [concurrently]

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Antonin Houska <ah(at)cybertec(dot)at>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Subject: Re: Adding REPACK [concurrently]
Date: 2025-09-25 18:12:41
Message-ID: 202509251758.t77p7r2ocmej@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

After looking at this some more, I realized that 0001 had been written a
bit too hastily and that it could use with some more cleanup -- in
particular, we don't need to export most of the function prototypes
other than vacuuming_main() (and the trivial escape_quotes helper). I
made the other functions static. Also, prepare_vacuum_command() also
needs the encoding in order to do fmtIdEnc() on a given index name (for
`pg_repackdb -t table --index=foobar`), so I changed it to take the
PGconn instead of just the serverVersion. I realized that it makes no
sense that objfilter is a global variable instead of living inside
`main` and be passed as argument where needed. (Heck, maybe it should
be inside vacuumingOpts). Lastly, it seemed weird coding that the
functions would sometimes exit(1) instead of returning a result code, so
I made them do that and have the callers react appropriately. These are
all fairly straightforward changes.

So here's v22 with those and rebased to current sources. Only the first
two patches this time, which are the ones I would be glad to receive
input on.

I also wonder if analyze_only and analyze_in_stages should be new values
in RunMode rather than separate booleans ... I think that might make the
code simpler. I didn't try though.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Los dioses no protegen a los insensatos. Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)

Attachment Content-Type Size
v22-0001-Split-vacuumdb-to-create-vacuuming.c-h.patch text/x-diff 70.8 KB
v22-0002-Add-REPACK-command.patch text/x-diff 134.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-09-25 18:31:44 Re: Remove obsolate comments from 047_checkpoint_physical_slot
Previous Message Jacob Champion 2025-09-25 16:53:44 Re: minimum Meson version