Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGVnX-00GkJ4-6t for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Nov 2025 05:11:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vGVnU-000NbE-AE for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Nov 2025 05:11:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGVnT-000Nb1-SG for pgsql-hackers@lists.postgresql.org; Wed, 05 Nov 2025 05:11:03 +0000 Received: from mail-yx1-xb133.google.com ([2607:f8b0:4864:20::b133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vGVnQ-005WZu-2I for pgsql-hackers@lists.postgresql.org; Wed, 05 Nov 2025 05:11:01 +0000 Received: by mail-yx1-xb133.google.com with SMTP id 956f58d0204a3-63f74b43db8so6487393d50.3 for ; Tue, 04 Nov 2025 21:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xzilla-net.20230601.gappssmtp.com; s=20230601; t=1762319459; x=1762924259; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rg7sJLZMKEBMOxSqKfv4kEr9q4RNiPrDu8DxZufxYBA=; b=KOJRwuCNdy+UtWk6ygbuTi9fBbkYMWTBR0/eTidMH/D4cBGrdx2ey4Yiw+oJ8958AG /sIJLyrwRn1iPib4N5ckNWOOPEudToZlBrEwgumVYRsL726TX15/DkeEcFWww17uBg35 bRYQswEyPVG0kd54lJJpkXWEGB+Tyz1V8VAVMe5Ni3Lqx+YtRBz0RDeXGx6UpDxDsuYG Etwp6BzfmDzTADVLGjnuzIPvt09DYlghQXunFQPo+z3GtT/8aU1p3u7GmKHvbgN7/WG8 aY6vYsMr64LeTewaFb6N10PhOrFhbdpZtTYXvUY/vq/BbtYryGGClvdFLdAKIU1JiiID Uu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762319459; x=1762924259; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rg7sJLZMKEBMOxSqKfv4kEr9q4RNiPrDu8DxZufxYBA=; b=H7Z33EO1soP+OCvCB1H7sb/7uY1HVITDAkJ2L7MS6RN+jecQyFmfEsFr1TuHfIZmuI 80HDH/kqZxJG+VZ6DeLk2Ud6kmoso/LVrzE2JUsix0SBQpAVI0ttWb7+JbF/9KdTl7Ov M2bbLUiH5bRNx7OIh3QsSy0uiyAwR0X1DM5Gc9D6Q/yOZvZkoBk8+ISPwCpQIukcLUKK 21JQlS028aAl8aW6w4hi8XIoM387b3PMc93vnOScuC8VJ9Vdn3aNaFZOD5KtD1kqPdkU 9U6TPSD29dcArogvSwbeM2WffOc0E4uiwQnNkD1xitN3hElpzKQ28srV/XAk+v8/eobL PCoA== X-Forwarded-Encrypted: i=1; AJvYcCXGmQnqAQazQpkRVOWUMgg4zGcKySxKCVL+B2rDVdp/4Q610u6+1IiZIek3VdJy5c+KjK9fKd0xRkvFYSOV@lists.postgresql.org X-Gm-Message-State: AOJu0YwIGsxxiXnIelkCTA1Knv2tM/omoF6RHRs/UsVtfhd5gcvV1KPC jsXxvnHTXZo1+O+17Zv4maJaXPhFi8kmXs59srcWmIGb/t/JYk4jf4p3QnEBtbQwMX8FW4dXPIH 1gNU8YsnsphsIJac0YdrAkbKPvVRdE4feRSlxejhe8Q== X-Gm-Gg: ASbGnctFCI4N2TSypEb4FPLfTP7s0pIdg707KIFxaTOu22gH9aFXYbweS/wQwMfI7xP K8a3rcMEUxoZvQ9+k21Cnfvgg+HgpBesCkjrxIr/uN74eDa3fT6kft5D7Dz0R0cYdG0favfM7qe D2hkdmTIGw24vm8wuaGqWU6P7DTQuZW7S9DEMwFgl41kXpo+M3UcRD22zb5N0V8VEP0HWTNeLJo oFN2DnKngAvlbiaWyJ5NylRfmi2EvCzEh23hehHRQ3jYx9IRDtn0oQP0uqa X-Google-Smtp-Source: AGHT+IGal3tzw9H8KQNJop/fO+OQFSlntJegLIVtW/DvM3YtDvyoZ9PthlzsqOzTI4tL0N3duLXgRUkfyUa6bnbR+xY= X-Received: by 2002:a05:690e:160c:b0:635:4ecd:5fcc with SMTP id 956f58d0204a3-63fd355d583mr1569503d50.41.1762319459551; Tue, 04 Nov 2025 21:10:59 -0800 (PST) MIME-Version: 1.0 References: <202507262156.sb455angijk6@alvherre.pgsql> <202510301734.pj4uds3mqxx4@alvherre.pgsql> In-Reply-To: From: Robert Treat Date: Wed, 5 Nov 2025 00:10:47 -0500 X-Gm-Features: AWmQ_bm16D1Csmjoq6w4KQhSyoYErhxlDFWfsBAIh9jIPHR-LtkgEcrjYr5PQiY Message-ID: Subject: Re: Adding REPACK [concurrently] To: jian he Cc: Alvaro Herrera , Pg Hackers , Antonin Houska , Mihail Nikalayeu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 4, 2025 at 9:48=E2=80=AFPM jian he wrote: > On Fri, Oct 31, 2025 at 7:17=E2=80=AFAM Alvaro Herrera wrote: > > > > Hello, > > > > Here's a new installment of this series, v25, including the CONCURRENTL= Y > > part, which required some conflict fixes on top of the much-changed > > v24-0001 patch. > > > > > pg_repackdb > repack and analyze a PostgreSQL > database > > > but with --all option specified, it's doing repack whole cluster. > (more than one database). > I am not fully sure this description is OK. > This wording came from vacuumdb, which operates the same way, and I don't think it's lead to confusion. And while I don't think we need to take away the option, I see no reason to encourage the idea that people should be doing cluster wide full database repacks. On that note, I'd take the "and analyze" from the refpurpose as well; the more I look at it, I see pg_repackdb as a replacement for clusterdb, with selected bells and whistles from vacuum full or external repack-type tooling, but at the end of the day that's a simpler model for operators, and helps draw a distinction for which features we DONT need to include, like -Z (ie. analyze only; if you want that, use vacuumdb, not pg_repackdb) > > 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 ] > I think it's laid out that way in vacuumdb to indicate that those options are exclusive of one another. I'm not sure how convincing that is, but the above would need to do more to make the switch imo. > ------------------------ > [-d] dbname > [--dbname=3D]dbname > > what do you think to expand it as below: > dbname > -d dbname > --dbname=3Ddbname not sure i am following this one, but the brackets are the standard way we should items to be optional, which in either case they are. > -------------------- > > + printf(_(" --index[=3DINDEX] repack following an index= \n")); > should it be > + printf(_("--index[=3DINDEX] repack following an index= \n")); > ? > I believe this is included for alignment, since this option has no shorthand version. > > 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? > no. (again, looking first at clusterdb, and also vacuumdb, neither of which have it). > > what the expectation of > pg_repackdb --index=3Dindex_name, the doc is not very helpful. > > pg_repackdb --analyze --index=3Dzz --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) > Hmm... yes, this is a bit confusing. I didn't verify it in the code, but from memory I think the --index option is meant to be used only in conjunction with --table, in which case it would repack the table using the specified index. I could be overlooking something though. Robert Treat https://xzilla.net