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 1vE4P5-004Bc5-4k for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 11:31:46 +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 1vE4P4-000G3p-3E for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 11:31:45 +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.94.2) (envelope-from ) id 1vE4P3-000G3g-Oz for pgsql-hackers@lists.postgresql.org; Wed, 29 Oct 2025 11:31:44 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vE4P0-004NGQ-2W for pgsql-hackers@postgresql.org; Wed, 29 Oct 2025 11:31:43 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-3d322b3fd7eso1363899fac.0 for ; Wed, 29 Oct 2025 04:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tigerdata.com; s=google; t=1761737501; x=1762342301; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=50ZGCQUuX+iWX1q/VWUYTVgC0zGH/XnMX2HyRDFMsdw=; b=gNB+Ps+UlQgBtSGeuC+yMq/cdb/+CmxDyTX6zVc4c48wNQ54Iao5Zi23jkgK61I2ri VKfR9vSahIndAAZEv3wgaZstCyEcxAVioj7YHfkZU1nVSi9sDlh/JeqLmPRZRZclh+KU csx/5zEHhqM6I9opsfaB6ltxd9bktUWky831V0EZzcAEZEIsbBa/RQRforFC1gC2YW0d J7asQQ4lVUKr9xwcxZnNHGXTifernPpEAHU4NAi69APc3JZqmVMgz/Xiut97W/urpBZo eB37lptH4aLQ+veaYl66e1bd0FhGbz9kpy1PdL2qMMcUut7vD2LAMcOMzod8tmr5ydcB Bp6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761737501; x=1762342301; h=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=50ZGCQUuX+iWX1q/VWUYTVgC0zGH/XnMX2HyRDFMsdw=; b=c0EgV0clE/iKgcX3nw25Qj/u0NI6hRNeNMPKXuSZ3oFpHIJffS3vq3ZYoh3ZHtEF5t kWkKfqROWDr9vA70y5klBEDM8S+4XOdm+PjSgia3cH1BKH6tuTuo7ICzPsc0YbM6N6aJ qEBks34kKGe9VauGlrvQhIqY8MopoLgrdEKOMNuhe/cHNtZ1LDYYx1ext7O2JuDYZPKl wvBvYMFeVIaSChsIimmYTAJzmfn9ZpxG5YW3ZDsmzHWkbaxQEBP7Q0DVavtdX7MpiAjx OPaeHHF/kg32csXkml/RiAdzOQLH8x+ZLQw9ItDiDmPj1mpdkO0Cxz07wopt53IrkCKf Eisw== X-Gm-Message-State: AOJu0Yz+vqd19azYjeQ6A1i/BxBUbhgveiU9yds3JFojq86tvEzWZ320 VvYneWqR2r/u/cKgkmiA9knPAw3RVjsouR9pbP/Rs9+T2JXcc9YgCJ4WxBO7EjW/Et/AFHQwHSy qnpLDIhwbNh9/P/rAQromjoM27+6RRdQ3B8vvgCiOo80VtunqGZqmNnQZRxgC X-Gm-Gg: ASbGncsWLzXvwPasvXU80RFDoXDbsgDNzep7uvab3pEvCPBvrulp9SScW2lbrO35uIR KW4R0kY//JKLSUStWuG9Lj9H1is7KBWi7t2s2/z3JVeeBbAiYDO84IHat4aR3h3WTrbYdskPWlU tPJ3oNFyBIxUFBSdQEBBxwPgMS6QFhlxBV3XKW5hAJrWVSMb3XRmd5Px8+ceD5V//6SxV6tZ6Ju jO3WQYZZDVcFUdJ+WTT/EitcF/4z9aRFGZC419wsuWR7Uta4NRnYlCo0yR8fC+7qPpYdadr X-Google-Smtp-Source: AGHT+IEKvQgG4Ksk6O5P8esPHaTOiqK0xJcFPMhd/ZalV0WFN5xeH8Ynyjb4LQ9aoIaEHnf8w5NfXbrxsbrdH1fIuuM= X-Received: by 2002:a05:6870:f214:b0:3d3:84a6:6525 with SMTP id 586e51a60fabf-3d747b2e26dmr1088538fac.33.1761737501500; Wed, 29 Oct 2025 04:31:41 -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> <87frb27zg3.fsf@wibble.ilmari.org> In-Reply-To: <87frb27zg3.fsf@wibble.ilmari.org> From: Aleksander Alekseev Date: Wed, 29 Oct 2025 14:31:29 +0300 X-Gm-Features: AWmQ_bna9HfBJLH2VU8J22-iPNSt_EanzCo6318kbTGFsTo1JwLnoJj_r3Z2hgc Message-ID: Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions To: pgsql-hackers Cc: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , Jelte Fennema-Nio , Sergey Prokhorenko , Andrey Borodin , Masahiko Sawada Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Thanks for the patch. > That does seem like a better fit. It's used mainly in recv functions, > which this basically is (but user-callable). > > Updated patch attaced. Perhaps bytea_uuid() should check the UUID format. Consider the following example: SELECT uuid_extract_version('\x019a2f859cedffffb99d9c55044a2563'::bytea::uuid); uuid_extract_version ---------------------- 15 There is no UUID version 15 according to RFC 9562, and the documentation for uuid_extract_version() says: """ Extracts the version from a UUID of the variant described by RFC 9562. For other variants, this function returns null. For example, for a UUID generated by gen_random_uuid, this function will return 4. """ If I read this correctly, either bytea_uuid() should reject this, or uuid_extract_version() should be modified to return NULL, or the documentation for uuid_extract_version() should be altered. -- Best regards, Aleksander Alekseev