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.96) (envelope-from ) id 1vLPxW-00G5Ul-1u for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 17:57:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vLPxU-007vXL-2a for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 17:57:41 +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.96) (envelope-from ) id 1vLPxU-007vX7-0l for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 17:57:40 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vLPxS-000Cef-05 for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 17:57:39 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 8AFC91D00333; Tue, 18 Nov 2025 12:57:37 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 18 Nov 2025 12:57:37 -0500 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=1763488657; x= 1763575057; bh=NE63CDlDX1HkmHzIe91mmPtHJbayT2XSaDF5r9hnc0I=; b=L q9MPG5Eb8BQ05tyTvJeXLsj0xvsjVFyk0bsHxS6t2d24JWJ+EyFq8QzBo26HSnLq cfyPfh4qJBm5oEvlhwiQOXW2KRAdrZ3Irl1VvKZ3ED7O9pHATcqos0Zj0CbTomyb TJnqfdHNnWOasnqK3azr4APN8ba19exc94HEHi3RtdDPXy60aeUJVK7yPDYIpGVu O36dAL7j/Gi2xE0++pjlUEzeaVP/tZWmYwuWEePniqEeOgC6VzbF27sJQqnidKaB O+xgYYcsy/vRrqQQ0fgtN3UG3L45KtdJ7WZBBuPSyiDmatJm+f2AoYmI3jiNEu7/ SECOTgZN0kNSYesl09V9g== 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=1763488657; x=1763575057; bh=N E63CDlDX1HkmHzIe91mmPtHJbayT2XSaDF5r9hnc0I=; b=eC6CaO3lgeWBnlArm MYuugXpud5eyF1SNV6sdBg7JwKn4XsvNwmeaFnHh7cf9PDuJJNw7bQHvF7F92icY TQrTZIh8+1Hu5v1JqWoxR1O6RVp+K8N5aaCFHR9S9EBPJkdqg/qOQ1PIbTQ225dg yPpW7nhTBZ7HlBCFAOJsjUlpxPxjwmA1ttAkSa55e6dEZLfA/2czzIwaqKzuvWbB 7xCIAgRC/rhZ+4DnPfGY8YBo4h9R+G3fGjnCZl8Wd6PVddX4ialx0QbU0Gu7RxVD NbgkgCkceFkSUSDrOOz8sNR6ySQBqARPl07MAQSF0quBrRfuA0aZKzae4mPWnkrO 4NK3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdduleekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeeuhfehteehgeehgeehgeffffdtvddvgfffueekheeuleefjeetteev vdelfeejheenucffohhmrghinhepghhithhhuhgsrdgtohhmpdgvnhhtvghrphhrihhsvg gusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohepie dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgr uhhtrdhorhhgpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmh grihhlrdgtohhmpdhrtghpthhtohephhhlihhnnhgrkhgrsehikhhirdhfihdprhgtphht thhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdroh hrghdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghpthht ohepqhhurghniihonhhglhhirghngheshigvrghhrdhnvght X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Nov 2025 12:57:36 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1763488653; bh=mAmSsrdXbHcXVsabK6gIDY1q8blKTtqcAm/b0Lne4W4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=RNmZZy06o2OnZc/Mg0aWkdAjpDT+y1ziq0N9Pl3LIv0E3QbR8Gr2MDUka9/vA3dWB gKw4ECegRtEZy8w1p2axi2SiTc6grI4hrAL9X7CqAx49/ch18hUAv/VU0EeEwmgVjz ff1Kx/Mcox9BzWtNECDnaR5ZM70cW9dmM9uP+lB3eMCVQxx1AtihtzNA2JAoXx8ONF g6l6EJxrP4P2z4rbMX0sglf5GYfmUQaVMc00u2ABJOj4diJ1T+TVzNlt6bNrLwiyx1 HaQNypZdYnqDCcc+JaJp0CQ8YVEWinBjrnG4lLB8+SQdEO2Lck5dRWyGYO6foKzxzV fwIKaQer7fmVQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 820FB76; Tue, 18 Nov 2025 18:57:33 +0100 (CET) Date: Tue, 18 Nov 2025 18:57:33 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Bertrand Drouvot Cc: Peter Eisentraut , Michael Paquier , Heikki Linnakangas , Quan Zongliang , pgsql-hackers@lists.postgresql.org Subject: Re: Consistently use the XLogRecPtrIsInvalid() macro Message-ID: <202511181738.yokxzijfdfx7@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Nov-18, Bertrand Drouvot wrote: > Hi, > > On Tue, Nov 18, 2025 at 04:54:32PM +0100, Peter Eisentraut wrote: > > RegProcedureIsValid() doesn't add any value over OidIsValid, and we > > don't have any RegXXXIsValid() for any of the other regxxx types. > > So if we were to do anything about this, I would just remove it. > > The patch makes use of it because it exists. I agree that we could > also remove it (for the reasons you mentioned above), I'll do that. RegProcedure actually predates all of our reg* types -- it goes back to the initial commit of Postgres in 1989, according to https://github.com/kelvich/postgres_pre95/commit/c4af0cb9d2a391815eb513416d95d49760202a42#diff-843ff64714a2c04906cdc890ccf6aedd0444e395e4ec412e70465638e80b2011R182 +/* + * RegProcedureIsValid + */ +bool +RegProcedureIsValid(procedure) + RegProcedure procedure; +{ + return (ObjectIdIsValid(procedure)); +} I'm not sure what to think now about this whole idea of removing it. Maybe there's some documentation value in it -- that line is saying, this is not just any Oid, it's the Oid of a procedure. Is this completely useless? > > For OidIsValid etc., I don't think this improves the notation. It > > is well understood that InvalidOid is 0. > > I agree and that's perfectly valid to use 0 (unless InvalidOid does not mean > 0 anymore in the future for whatever reasons). That said I think that using > the macro makes the code more consistent (same spirit as a2b02293bc6). Well, what we were trying to do there was get rid of XLogRecPtrIsInvalid(), which was clearly going against the grain re. other IsValid macros. We got rid of the comparisons with 0 and InvalidXLogRecPtr as a secondary effect, but that wasn't the main point. This new patch series is much noisier and it's not at all clear to me that we're achieving anything very useful. In fact, looking at proposed changes, I would argue that there are several places that end up worse. Honestly I'd leave this alone. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Ellos andaban todos desnudos como su madre los parió, y también las mujeres, aunque no vi más que una, harto moza, y todos los que yo vi eran todos mancebos, que ninguno vi de edad de más de XXX años" (Cristóbal Colón)