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 1vE3mf-0041lq-U6 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 10:52:05 +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 1vE3me-00HV9l-Mi for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 10:52:03 +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 1vE3me-00HV9c-1R for pgsql-hackers@lists.postgresql.org; Wed, 29 Oct 2025 10:52:03 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vE3ma-004rpz-1X for pgsql-hackers@postgresql.org; Wed, 29 Oct 2025 10:52:02 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7239A140026B; Wed, 29 Oct 2025 06:51:58 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 29 Oct 2025 06:51:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc: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=fm2; t=1761735118; x=1761821518; bh=sReBKXQULe q24+bW2DA4VHH2gPyX9RS8nQEewayBWSA=; b=XSgxj4b8r4fJKnGdycglwRPuRr UbUfx8SlULhYfpljwilKtDpP7QUXE+iUQTPWh/LZTpuTPnGPCb6wWik//KgGKJ2f A5GfPv71KOUVD2lleZn5qUVBb9AgpS/QFzDGSwXjw28eeii8IJFjH359xB7fvIrb PfFyAf/GAqtGdcHVUgMgLAg4MhT1YIa173wf4y9eJ7oUpU6wf4dtZiZqNRkBBCrU vW2JpT+Za0hngBMkKT8uTNffpCaRFNG7QqRM+tjWXtsoVksliC5XDhc0t1NZo93S p+poVtxhqphNDxQd1MneLJARuBG1UsW1Ni2XhBOaI68pZTGWl356XwmdPSng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm3; t= 1761735118; x=1761821518; bh=sReBKXQULeq24+bW2DA4VHH2gPyX9RS8nQE ewayBWSA=; b=vO0zXKz9oKfIGtPXh7cICQXz5t8RZEAAbwWNpZu9HiQ05JW+sCr MMGWTmS3cKtju6eJieNCD/4URXWZZWcADssAo2SKsjrlwcV+MMKkykokBceLERiM NxePGVuAlwTbjOPBP22/DNyVFg9LyoiitYiIPo6cQo02v0qCjMR4ZKVQfWXYZHbz dP8IRGoy8iMh0ta+z4uWQ6NVxyIDnAc4g3tO/UzZNnNcydeAbjC2lPzR3kTVioTV Zo5rvQMuPR5D0tFjvY8AWupddP8y2Go7EOywRJTpcBBhW4TYJponEH1KOcjuWWT8 OSVPVlgNVdDk9PC2HYqjg1Pcjhuegs1UctQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduieefheegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufhffjgfkfgggtgesmhdtreertderjeenucfhrhhomhepffgrghhfihhn nhcukfhlmhgrrhhiucforghnnhhsnohkvghruceoihhlmhgrrhhisehilhhmrghrihdroh hrgheqnecuggftrfgrthhtvghrnhepvddvhfehtdefkedugfetudefhefggfegjeeijeeh uefgteehgfegtdelgeetteejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepihhlmhgrrhhisehilhhmrghrihdrohhrghdpnhgspghrtghpthht ohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepshgrfigruggrrdhmshhh khesghhmrghilhdrtghomhdprhgtphhtthhopeiggehmmhhmseihrghnuggvgidqthgvrg hmrdhruhdprhgtphhtthhopehsvghrghgvhihprhhokhhhohhrvghnkhhoseihrghhohho rdgtohhmrdgruhdprhgtphhtthhopehpohhsthhgrhgvshesjhgvlhhtvghfrdhnlh X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Oct 2025 06:51:57 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Jelte Fennema-Nio Cc: Sergey Prokhorenko , Andrey Borodin , Masahiko Sawada , pgsql-hackers Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions References: <1791665551.452444.1761209220211.ref@mail.yahoo.com> <1791665551.452444.1761209220211@mail.yahoo.com> <18022523-0F8F-4C07-AFF5-57DC9086D78E@yandex-team.ru> <1895971769.8343.1761240853939@mail.yahoo.com> <574624399.175025.1761290201491@mail.yahoo.com> <953203149.383019.1761345585325@mail.yahoo.com> <6F76FA61-E2DC-44EF-9504-889D9BDB4EBD@yandex-team.ru> <1154454839.957923.1761604611424@mail.yahoo.com> <87ldkv8cog.fsf@wibble.ilmari.org> <87ikfz7zcu.fsf@wibble.ilmari.org> Date: Wed, 29 Oct 2025 10:51:56 +0000 In-Reply-To: (Jelte Fennema-Nio's message of "Wed, 29 Oct 2025 00:35:28 +0100") Message-ID: <87frb27zg3.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Jelte Fennema-Nio writes: > On Tue, 28 Oct 2025 at 17:41, Dagfinn Ilmari Mannsåker > wrote: >> Here's a patch for that. > > Looks good to me. Maybe add a test where not every byte is the same though. Good point. I've replaced them with two randomly generated ones. >> I'm not 100% confident about the error code >> for invalid length, but that was the closest one I could find in >> errcodes.txt. > > The errorcode you chose seems acceptable to me, but I think a slightly > more fitting option would be ERRCODE_INVALID_BINARY_REPRESENTATION. > Error codes in postgres are pretty arbitrary though, so either seems > fine to me. That does seem like a better fit. It's used mainly in recv functions, which this basically is (but user-callable). Updated patch attaced. - ilmari --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Allow-explicit-casting-between-bytea-and-UUID.patch