Re: pg_utility ?

Dmitry Dolgov <9erthalion6@gmail.com>

From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>, Christoph Berg <myon@debian.org>
Date: 2025-11-18T18:30:36Z
Lists: pgsql-hackers
> On Tue, Nov 04, 2025 at 06:52:19PM +0100, Álvaro Herrera wrote:
> One of the things that came up during the pgconf.eu talk about REPACK,
> proposed by Christoph Berg, is that adding another utility pg_repackdb
> to run it from the command line adds more noise to an already noisy tool
> neighbourhood.  He asked, how about we instead add a generic tool to run
> utility commands?  So the user would be able to do things such as 
> 
> pg_utility vacuum -t tab1 -t tab2		# what vacuumdb does
> pg_utility analyze -t tab1 -t tab2		# what vacuumdb -Z does
> pg_utility vacuum analyze -t tab1 -t tab2	# what vacuumdb -z does
> pg_utility cluster -t tab1 -t tab2		# what clusterdb does
> pg_utility reindex -t tab1 -t tab2		# what reindexdb does
> 
> Each such tool would retain more or less its current behavior, i.e., its
> ability to run things in parallel, to discover tables to operate on
> based on circumstances, to silently ignore objects depending on the user
> lacking specific privilege bits, and so on.
> 
> This way, instead of an entire pg_repackdb tool, we would add just a new
> mode to pg_utility:
> 
> pg_utility repack -t tab1 -t tab2		# what pg_repackdb would do

FWIW I find the idea interesting, it would help structure the tooling
landscape. Looking around, looks like it's common to have some sort of
manager or a toolbox for similar purposes.

Would it only be allowed to run anything involving CMD_UTILITY, or are
"utility commands" meant here in more broader sense?