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 1uoRSn-0040fO-Q7 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2025 18:53:43 +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 1uoRSm-00GPlB-Vy for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2025 18:53:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uoRSm-00GPky-Dw for pgsql-hackers@lists.postgresql.org; Tue, 19 Aug 2025 18:53:41 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uoRSj-000lcc-39 for pgsql-hackers@lists.postgresql.org; Tue, 19 Aug 2025 18:53:40 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 13472EC03B1; Tue, 19 Aug 2025 14:53:36 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 19 Aug 2025 14:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1755629616; x= 1755716016; bh=/DpAYJogAwBxfnjl8p22aDUYl6VeaCExPvj1c7Z5Obw=; b=Y 2+FNqG3k/RXz6Poypn8d+ytqpEpIHjn0xKssR8OpWNjwroPOTna2OVaUMocu+adb RDVpPtf9isQtSBfJ+5QtvqL4XMfhstcQavzYkFngZFH8KGgij5BcOaW8MvHK26i3 jgx1mrpxgjLYyNR6lxm41i4ztrF1tzbxavGt3IczXMk0rWtZIGqV8ueDiN2ZuLYJ J2A+rBbW5IMREtGU9knrV0rQjFv9QVoil5zgxJCzr9cPzV7OgMGtiJXyZwkxY5qQ O7XoVeaY7pwbAobcDwVHrajYTueMHrJTRFN18p9HndfipQaXwY9lbg7mXZC936DO m0jKJC+RS/ybAIyve8wMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1755629616; x=1755716016; bh=/ DpAYJogAwBxfnjl8p22aDUYl6VeaCExPvj1c7Z5Obw=; b=SZUxF2Nt8bB9+qlJ+ UFopmAtriupF4X/xZzwSb8pC3jB9Hps61znZGtlhA4Q1pvCyeJE/0ykX/NQAXgeA QnxnrLx3HOVQzlnW412IZtkZAg1SXYidh3/4hzxQkvq/rIxHIGSKDL0rFjIIP8F+ 5Amn7OLpNthyRy5LF216NwWwlpu35b8fA6XYTBO6ipfOwKYREsJYKxUwjiRKD0/q Fxy5GxQk2qIZNYlgefyl2i4PVcRw5xudNCADjWOvjUjOZHxrcRN9EFwconp4avV8 8itOhz2joV4adto/wfz5moD3gxJ+q76dkYmizofp6slQd1W6F3odFwTD83CQwnDg FrAnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduheeivdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeegudetudejheduveevgeehjeegleevveevvdeutdejtdekuefhheeh geevtdejteenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphhtthhopehmrghs rghordhfuhhjihhisehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhihhgrihhlnhhikh grlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgv rhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehrohgsse igiihilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Aug 2025 14:53:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1755629612; bh=GMdn51sscQX7BxldDDzZ/PnfxR7fBLm6LsqTBSVQ4Kw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QhZBpA79wHbpgfcsmWgDAFnEX/JT8p/CFoohC2/ENg2On5FuePS3YA4JRxPFfCuDi tQIxYpTnEY2KvGpinj0T/WfduMMnDOebxjVOehzrR3hmda2lEy89EAn5sgHJd5P3yr adWksCbUdCDcJq/ni1m0k9TsnP4bMkO2D+vdsQj2MCbrKcUzYXxO3D/sir+0SHBtKW vuug1xuGaw0DaxRTObml1GcW6eDkyr3Xm+1PtD7XUNMkA7lomi0i1nphHH/OYLxASA J1x5QDbD9LIH/9EnPHvI39kbNQQpcEBl1xH1Ym3caQfzlHSGLavq/0h1J03c6X+551 lEZAzXuAO5YJQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 5D10792; Tue, 19 Aug 2025 20:53:32 +0200 (CEST) Date: Tue, 19 Aug 2025 20:53:32 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Pg Hackers , Antonin Houska Cc: Robert Treat , Fujii Masao , Mihail Nikalayeu Subject: Re: Adding REPACK [concurrently] Message-ID: <202508191853.wofznwocbi5x@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="royo2gase7keei4n" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202507262156.sb455angijk6@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --royo2gase7keei4n Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, Here's a second cut of the initial REPACK work. Antonin added an implementation of pg_repackdb, and there's also a couple of bug fixes that were reported in the thread. I also added support for the ANALYZE option as noted by Robert Treat, though it only works if you specify a single non-partitioned table. Adding for the multi-table case is likely easy, but I didn't try. I purposefully do not include the CONCURRENTLY work yet -- I want to get this part commitable-clean first, then we can continue work on the logical decoding work on top of that. Note choice of shell command name: though all the other programs in src/bin/scripts do not use the "pg_" prefix, this one does; we thought it made no sense to follow the old programs as precedent because there seems to be a lament for the lack of pg_ prefix in those, and we only keep what they are because of their long history. This one has no history. Still on pg_repackdb, the implementation here is to install a symlink called pg_repackdb which points to vacuumdb, and make the program behave differently when called in this way. The amount of additional code for this is relatively small, so I think this is a worthy technique -- assuming it works. If it doesn't, Antonin proposed a separate binary that just calls some functions from vacuumdb. Or maybe we could have a common source file that both utilities call. I edited the docs a bit, limiting the exposure of CLUSTER and VACUUM FULL, and instead redirecting the user to the REPACK docs. In the REPACK docs I modified things for additional clarity. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Selbst das größte Genie würde nicht weit kommen, wenn es alles seinem eigenen Innern verdanken wollte." (Johann Wolfgang von Goethe) Ni aún el genio más grande llegaría muy lejos si quisiera sacarlo todo de su propio interior. --royo2gase7keei4n Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v2-0001-Add-REPACK-command.patch"