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 1v1qSc-00DDV6-JD for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Sep 2025 18:12:55 +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 1v1qSa-004RYS-Qv for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Sep 2025 18:12:52 +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 1v1qSZ-004RXw-Dz for pgsql-hackers@lists.postgresql.org; Thu, 25 Sep 2025 18:12:52 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v1qST-002PRl-1S for pgsql-hackers@lists.postgresql.org; Thu, 25 Sep 2025 18:12:50 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id A7F17EC0201; Thu, 25 Sep 2025 14:12:44 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Thu, 25 Sep 2025 14:12:44 -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=fm3; t=1758823964; x= 1758910364; bh=nPwXeqQRmRrm7lPwgOCbD8g3ZJ7NshVOqVlVQ4lXkEE=; b=n rSf+VcoP+ah6vFGSWsIghO+HbDDJlYuqbaeiTlfjaTpj1pNu3szXxkAM54vaP1dr 9rwUwzkzE1XFKiWgeYxcNoVt3OFfzskL3mmAXDaB3HG8IfoS45eTjRWhaBVp3rcZ DNtHrEfU50HeIRwdZCA9I3yrFpsjtWJANPgndElp+2kK3OIRVrGA+It96qAunklC L4OHtdJlD2amaajc9jlvgHTVRt+9AA8EDvOBWpW45YU6kay9FJGC7lAo5EAEOeqJ /9QT+CJVNv/MgHkpBRJDnna4lJj1Y9Lns3KBIVtauCWyUodEwF20tRDTOjsRTf9y UZPclXoSoLiLOIUqxoInw== 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=fm1; t=1758823964; x=1758910364; bh=n PwXeqQRmRrm7lPwgOCbD8g3ZJ7NshVOqVlVQ4lXkEE=; b=LiAuzrnxzlPDSTiz9 o5bCzRt0bT2KMFKj2hRljGb0UftMqueOyC65zH6+EzYksw4Dzta7OZOieC2S2fBd aqNfGbRdelgmgynuqieezSgWdTaawofq1j1EalGH6rcitMwOHWN/1bb5OUoBMoLT lxhKM5GJeYL7S7QJzFWBF6FE5O7vRuGRAFmz7cObzVgmjtnOXLH1bDTVVtpaMpBl L0dDBy2XHKDGPb5io5bXIymC5eAT7GuUbkIr7W2rthrKZS/jy02IJU0iQ4CJIDEk tEtJzyEEjMPEC5hy+EMLZP3O5IAb7MtY9UUuy/DIApPyF3wkGE072CcV0maAEjoM dlWIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeijedujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepgedutedujeehudevveegheejgeelveevvedvuedtjedtkeeuhfehheeg vedtjeetnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprghhsegthigsvghrthgvtgdrrghtpdhrtghpthhtohepmhgrshgr ohdrfhhujhhiihesghhmrghilhdrtghomhdprhgtphhtthhopehmihhhrghilhhnihhkrg hlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghr sheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprhhosgesgi iiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Sep 2025 14:12:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1758823961; bh=BAQ0STS78kMXB22akwWBBYebadsJZcGiRRw2hF2sbvo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=DkaI8xfFKLcvT76WO07QaHOUkb1r0/zfvL7vtZ8+C7DrX1KphAxeJ/pON7YDZHS3h xVU6qClY/JAGP0cMyp18t2sajlPLOBV4dTl/p32mTgrs7c+/ZxpJwP5z0+H4Gb/tv/ b0Je7/vwK++rFwN69SHmqIN1/ZRgP/WPmXSV2CpWbqJSNInGeBdUQs+rCvl91BPu/W L0phZZ6b8PJksd4eCp8J5IE3od5F38uKXlDfBEaBHsXY2tDtQwIAWKoh7B7WuYyDv7 dXawkkQY1l4ku+snENH3OIYqpvwzhQexHil+cPGS0B+X7MrOs5QA5f+yRXYKBQUL3J HtIlmquj2X78Q== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id CAB9071; Thu, 25 Sep 2025 20:12:41 +0200 (CEST) Date: Thu, 25 Sep 2025 20:12:41 +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: <202509251758.t77p7r2ocmej@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="52vaejy5wnlkvc5v" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202508301750.cbohxyy2pcce@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --52vaejy5wnlkvc5v Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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) --52vaejy5wnlkvc5v Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v22-0001-Split-vacuumdb-to-create-vacuuming.c-h.patch"