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 1vDtEB-000fwG-Ck for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 23:35:47 +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 1vDtE9-00FfIp-LH for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 23:35:44 +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 1vDtE9-00FfIb-9S for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 23:35:44 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDtE5-004mSp-2R for pgsql-hackers@postgresql.org; Tue, 28 Oct 2025 23:35:43 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-59390875930so754704e87.1 for ; Tue, 28 Oct 2025 16:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1761694540; x=1762299340; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oQ8Fn18sFJMkdqvg2fjkqQImRhCMqXBfFPjEXmtmb38=; b=BNB0ElpPHfZ2Th+CWyS86U1chgRD2NZMnFPxghqZN5yjiR95MOO3KWE7oCsbNlndb+ x+iQoneq5v8hx44G/ZiCEVTyJrguWpDRSG++jIb96woHCBcy0KBrWjueibQsGCQ2cx/S I3rpzsnmw7T/A2cHkcxciS3pCXOnBwDqFVS3cLwFn9NVCKg1DyAM+x1GtzvQTWsTPmdV HrerO51DCy/sHU0bmR54CefySqodsrhcYnhUzle/D7zC+eLSVy5w8XFzQYeQVNz0SXgd DmQMXL2CF/zbvhJ6+RBXu7PIXuZJcz3L2bDafmRmvrLK39W6QOCxBzOIhtJPzZ/P7K5S N0oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761694540; x=1762299340; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oQ8Fn18sFJMkdqvg2fjkqQImRhCMqXBfFPjEXmtmb38=; b=wIHGDE0BWZO+DCRq1szZDEPt6YEwSW5bp3b/8gfXskbNKMU9jlK6IInyE0WRnvht0M /PNpOAe5f2Va76ms6MUUjsZU4GpH5cj5KRjziNnUWxQBlar3nacwYwl+74SIE7G5g4JP RRdH4VkX7vbYmBYnz2r/UsWOHO9acsDS/qB3TGzvkmPTyTCk5RNXQFL1H+bC0SINtB8P 7gJbE+3jkozl58/pXjR/iU18JwXTGfo5l2+R5jO6cNg3V/grt52G0/SD513m1EQua5zf AqdhlgCvjCVWmxur3RDg4GTBfjlGYEbn6Hzx7bu3A6SCX4P9Jt6Ut35nFHZkw1fD5sUG iAGg== X-Forwarded-Encrypted: i=1; AJvYcCVD3HRj2wZhXu8DgZDUHM1vwXM5mGfJdKvc99vVfwo0kYpmugaKTT6c0+wdgtL5s6OzICDWmdqkvrhznWMT@postgresql.org X-Gm-Message-State: AOJu0Yxgx8E7LqB1fGndUHkXQinYfRrs6hs8NpljrxVY/BcMRysnY927 MKvp2q135TsMyN9Gt098b0CMN9PvnRqoKhu+byx/xAJ8hiMSgoVgfcwydaqYgTxj9w5tFvcMBrT fdwR70A2MpAVhCxBlKZNAMPoR/EFV/rQFuRIgfgIP3Q== X-Gm-Gg: ASbGncu5p8G+KMlF10B7ls2/GW7ss74DJILoOXqmT4JICecrWGpmI3hcrVPRq2OqC0Y hjnYa8t3loJEWQdbSEPnmqfbwdFPetUAsBhed3ytvI7fySLLCQM4Cd+FpgjpJOgBUrcXNgKwJmL Wrf3vK+pheYnwHDQWyNPT9WuKn9WHiHOgDWfU1DeuiA+u7MDIiATm7G2VVSvTv2nOd3tuquLpsN jqfBTQlCAlvxy+FiYtXU2uxMRCwDwC9vjd6ml6pjlabOUnywxCe0KZDehaA9w== X-Google-Smtp-Source: AGHT+IGFDj3sW30/5rIliNJGUjqcxM+83CoZB8U0+iGoCA2F6FBDCAIJ9pmOpL6KJMtVH5g+kTApkQlOwMAi3FOHOiI= X-Received: by 2002:a05:6512:3a8b:b0:578:ed03:7b96 with SMTP id 2adb3069b0e04-594128b156dmr346133e87.34.1761694539634; Tue, 28 Oct 2025 16:35:39 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <87ikfz7zcu.fsf@wibble.ilmari.org> From: Jelte Fennema-Nio Date: Wed, 29 Oct 2025 00:35:28 +0100 X-Gm-Features: AWmQ_bm7Ehc2amWSWzMo9MYV1nNo8-TkSsaNU-DgKhDtQtKrVpnyyeWKnHFr1m4 Message-ID: Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions To: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= Cc: Sergey Prokhorenko , Andrey Borodin , Masahiko Sawada , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 28 Oct 2025 at 17:41, Dagfinn Ilmari Manns=C3=A5ker wrote: > Here's a patch for that. Looks good to me. Maybe add a test where not every byte is the same though. > 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.