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 1w667u-003wrS-0b for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 12:17:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w667s-009Z1s-2E for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 12:17:21 +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 1w667s-009Z1k-1L for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 12:17:20 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w667r-00000001JX6-0RMU for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 12:17:19 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id D51CA1D001ED; Fri, 27 Mar 2026 08:17:17 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 27 Mar 2026 08:17:18 -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=fm3; t=1774613837; x=1774700237; bh=zM/EMvpTmibr7A8uX98P7zD0xDFPCnWA lrvEHMaJ+uk=; b=GHlakZAAI6BBT6FJ/UTA+Ny0pavy2b7AjbKzXbOmfa6FivPW nUmJrS6vxX4CSI/RcSrYKONFEoqsdzEZ33gAALwSl315S6z5qyuFfcJtNiqay8jU j12iWl+5BG/Nhfnh47ULeg07gTkoyXpRm1kh0BdptF47P3pH8OzeBLhac1TjakWW 2LxCNHLmklycoA4aYpqydfIZdz30vR5eLQedk2o6qnUyFbWA/AdTJkWr38Lh1K/W riKO/H90DncYqaxPNuHkYAnQpeEhGH8AP5KebdVBU6Qg0qkCqRaYRSLdpc3Z4LoI AKwvEWs9+83xtcZJ8g5sX4Xhcxw7EXrXozOcSg== 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=fm1; t=1774613837; x= 1774700237; bh=zM/EMvpTmibr7A8uX98P7zD0xDFPCnWAlrvEHMaJ+uk=; b=g Uz19Lyg6wt8yTEKpTUZsgNM4R3VCOR5swkFON8w8V5kEkRnM4zaRoEvWUY6iw9vR waID4nGMzvhHrfAtwxXEyX2vDfX9vt1Xye5FjuCEo8H7yPxyDFFcvg3xH6PhKPMR AhZv1PbwmBS5+aAMIxFPEMFALaflPRgLxvxmPlcjusVf/IIYoSKhGLOKphgkDDMf 6fqSDcVE2Su88+Ltm+o+xRe2QK8Be9irNf/vQciKikwDDrCNUaMvBV+B4gosAuh+ omPOgMWett7vjnlnKtYNofUu+1zq48ItsilXxanXvujJ4T+O55W8mdBRltoDkcxd V31t2f9hwNvSCtFVH9HvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffedtvdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgheqne cuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfeileehteeljeeghfeuledthfeutedv ffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthho peehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhgvkhhsrghnuggvrhesth highgvrhgurghtrgdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehp ohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehrvghshhhkvghkihhrihhllhesgh hmrghilhdrtghomhdprhgtphhtthhopegughhrohiflhgvhihmlhesghhmrghilhdrtgho mhdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Mar 2026 08:17:16 -0400 (EDT) Message-ID: Date: Fri, 27 Mar 2026 13:17:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Define DatumGetInt8 function. To: Aleksander Alekseev , pgsql-hackers Cc: Kirill Reshke , David Rowley , Tom Lane References: <2869012.1767023578@sss.pgh.pa.us> <7f39480a-4b7a-4a51-a9ec-d1189b44432d@eisentraut.org> 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 13.03.26 11:55, Aleksander Alekseev wrote: > Hi Peter, > > Thanks for your feedback. > >> I'm tempted to think the correct direction here would be to use uint8 >> and its associated macros and functions more rigorously, not less. > > OK, if my understanding is correct this leaves us char_increment() and > char_decrement() which currently use DatumGetUInt8 inconsistently with > CharGetDatum for the argument and return value correspondingly. > >> I don't think it's worth making an isolated fix here for the one use of >> UInt8GetDatum() > > I think you meant not this particular change so I included it to the > patch. We can keep nbtcompare.c as if you believe this change is not > that important (it arguably isn't). > >> The change in pageinspect looks correct, but then when you look >> nearby and further around, you will find that there are also a bunch of >> (if not most) UInt16GetDatum and UInt32GetDatum that are wrong >> [...] > > Agree. I did my best to fix all the inconsistencies in pageinsect. > >> There are a lot of opportunities to clean this up, and I suspect that >> while many of these will work either way in practice because the actual >> values don't go far enough to hit the signed/unsigned boundary, I think >> there could a number of little bugs here to be fixed. > > I believe you were referring to places other than pageinspect. I will > investigate and create separate threads with corresponding patches > later. I'm moving this patch to the next commitfest. It's worth continuing to work on making this more correct, but AFAICT no bug has been claimed here, so it's not worth rushing this now.