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 1wGBoy-005yUa-1y for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Apr 2026 08:23:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wGBox-005Ueo-1T for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Apr 2026 08:23:31 +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.96) (envelope-from ) id 1wGBox-005Uef-0X for pgsql-hackers@lists.postgresql.org; Fri, 24 Apr 2026 08:23:31 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wGBou-00000002nMD-37v6 for pgsql-hackers@postgresql.org; Fri, 24 Apr 2026 08:23:30 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9E707140006B; Fri, 24 Apr 2026 04:23:26 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 24 Apr 2026 04:23:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1777019006; x=1777105406; bh=Tpn5hhWPPACFSZl4yUQ7+onlpSpkovfY N2LjDc+RLyI=; b=IJ5+quFjLs4qqhlZi0Gy+qO/LBrA1TFz1+2YUaoFEwh0MS7A xZr6gODy4M4sZmNsugffyCsl3nwYnb6S2DBIkfo9FAaPmkij4YFjzWLEzvosHBTw utX3Up7svCewCOXMUYzXnF59Lk5JqCs+EtCs4NXK1JzK9CJl57O/I4ezMAQU4q8a bdCnxtBj2yKaGVUrxrEgIOO+1mMJP5t23UxFbGyNxzafnDvlSC10xEG/XO+KSgte GYVtWzeg4L9qVAPXetnHMui64+2B2376+fN7Onf/5jXk/fKWKOsc7zEseC7HGs7n HKOugzVGx6dRgMfKGcpjvq5EUAmSFxxU3kwhJA== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1777019006; x= 1777105406; bh=Tpn5hhWPPACFSZl4yUQ7+onlpSpkovfYN2LjDc+RLyI=; b=n ZZZMSCw6HMNntuv9H1i/8bM1o6PLQKih9vzG6adtLOZ3RCXkmGbjKanVbzyeGbi2 hjtLqcux1i3QQQFZi1fyLsCjX6PK1L6XomcdR2G0KabuuvBm6dr4jX6nwVkh4vS6 eHaImNXSrCVVtbyfcCCR6HAf0l6yMECvSIWWQlwbIjYia2WKFcydRCQipkfdRUFz DSBX/8q8VGmz+8wBQCbAkEDK4itR79bss2JmPyt1AN3/tG0TOZf7ElvUYFD6b8H7 LmSDR/fVDreJQM9XZLOyLRpdo5Q2wycJnZVvfvaB7G642uF6iDql4tVe3h4d0wQW m3FHKrelY34B9TIZP5eyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeileehgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgvrhcu gfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqeenuc ggtffrrghtthgvrhhnpeeljedtudfggffffefhieetfeehtedukeejuedtlefhgefgffdu jeehueefudffkeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghi shgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghpthht oheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoheptggrrh holhdrlhhivddtvdehsehouhhtlhhoohhkrdgtohhmpdhrtghpthhtoheprhhkhhgrphho vheshigrnhguvgigqdhtvggrmhdrrhhupdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepiigvnhhgmhgrnheshhgr lhhouggsthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Apr 2026 04:23:24 -0400 (EDT) Message-ID: <97f9375a-be61-4272-a44d-408337fe8fa6@eisentraut.org> Date: Fri, 24 Apr 2026 10:23:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Use correct macro for accessing offset numbers. To: Michael Paquier , Kirill Reshke Cc: li carol , Roman Khapov , pgsql-hackers , zengman References: Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14.01.26 09:08, Michael Paquier wrote: > On Mon, Jan 12, 2026 at 01:51:10PM +0500, Kirill Reshke wrote: >> PFA v3 with fixes for signed usage across the tree, with my new >> findings and suggestions from thread > > Note that the change in get_opfamily_member() is not right based on > the type of "strategy". The rest was OK, so done. The thread [0] is proposing a patch to change these things in the opposite direction, effectively reverting commit 6dcfac9696c. I think the premise of the patch in this thread is incorrect. You have changed Int16GetDatum(offset) to UInt16GetDatum(offset) because the variable offset is of type OffsetNumber, which is uint16. But that is not the meaning of the "UInt16" in UInt16GetDatum(), at least that's the argument being made in the other thread. These values end up being converted to an output parameter of type smallint, and the output function int2out uses DatumGetInt16() to convert its argument. So the *GetDatum() function should match that, so we should use Int16GetDatum(). The real problem here is that offset values that are uint32 are being output via the SQL type smallint, which can't handle the whole set of values, but this is probably not a problem in practice. [0]: https://www.postgresql.org/message-id/flat/CALdSSPhFyb9qLSHee73XtZm1CBWJNo9+JzFNf-zUEWCRW5yEiQ@mail.gmail.com