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 1vBs2R-006FUb-Ou for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 09:55:19 +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 1vBs2P-007oly-IV for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 09:55:16 +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 1vBs2P-007olo-7X for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 09:55:16 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vBs2L-003KPi-2w for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 09:55:15 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-651c67430d5so270783eaf.1 for ; Thu, 23 Oct 2025 02:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tigerdata.com; s=google; t=1761213313; x=1761818113; 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=gAqpXxggX2Ppwi5692J+RHwPxqhlxlRN00s+fY+uqUA=; b=cSlXC9slbQFmXuiEkmQcJDLoaQGCafbZE5hquydvl9P6+F+Mq3TagUNAZg31nSXgWQ qA3JDoL85m13gzhIXjG+kGEq3lKjbsnFARlAjOZ7SE2kZtn52ChXnY2j70y7c6gE9c3t BjqaIlLgrWkm2eoC1s9qkJA7ex6Q6okdmBK+4hEPV01qFmOsgoHMBClIUTujvyUGxzs+ 2QCS+ff17Cig01Hx2muSJnR+9MM4AJkrAofFe1Bzw+mz97rUPpcGhk4JYZKVE5TEzPyu HRXXV0r/JlAjOs1HgHOvcrgagBcHWmnLgSHKxznPB97HN3F9ShRLcF6lJQQgojLVeUuH VUDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761213313; x=1761818113; 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=gAqpXxggX2Ppwi5692J+RHwPxqhlxlRN00s+fY+uqUA=; b=okMd0KB9zfMlsZIA7h+0YIVTiQ7REas4dg4HmCwIyqWNR5xRMFinhE3K9TN5UzCyXC dd3nMfFlVYwPBTlbnBx6Mn9HTbr1r72rdVkMQTPlrx4kZZYVvmsDb4p9v2al5E7XqnuI Z5EmrPNLpC3FM3yTc0esnlqB4PvVCgDZm6wLR/kt8PYAYYP+jmidN9W/f9tuJcGvDYy4 Tfi6suhT9CRjKGyLZ8gyZkEZHujQlentAXaiKsA4AW5VHCfrDFqTA31P5e3mgZa++387 kE7Q1yFn8zOX5mzvq3LDFkxv6gixS66L7fYGxpMhcPO7WRWxVCy8uph3hlHVH74yyoMg 24tQ== X-Gm-Message-State: AOJu0YyJdyEeh44qM8MzEg+uX1r60NRk0zYnsgjTz6HsnN+w+N6V6xOn SJ6IzebBvDRz7X/AYh0LcbrM/wxgdaTTfIrTpfMA55N3d6+dxmaig8iM/0XbMpOjNBhcll0II8Y OsxBF/2CqligvGZhAYQuTXL0aqJOlAGPziPhEviLDieroN5YwzEvEYlsnHfpk X-Gm-Gg: ASbGnctA2Kc2STih469JCVDQeJ1lrqFI2aKgfsXX4+MHP0J9v+rQikNVfgOO5l36o7z eDiuB3BxMoig6jFML9FODatvKUtlh/RWF2zWdCtjx84BjovHBFQl2zyYtKnpxjVIHGb1uRtNz6t cps5haJHwszJ5fvfHsbhhIm6lV9QNXht/5smPBouB1ET6zpb0eySJK63bpoSdxwW+SA2nyKoXPN R68ZKhWGq5njwmJeRL9sPPh4Wrs/dgPlaYuoXo07iA8H5YhlEHGi/nygYb/NA== X-Google-Smtp-Source: AGHT+IHvUBsOJUi8X7wUBv1DhK1A2CZHhdgTox0XyFUKxBS3O2S1gQiO50Qot4VTiSmxsgDjdWo65X572Jj6qYsiuhk= X-Received: by 2002:a4a:e913:0:b0:651:d041:d167 with SMTP id 006d021491bc7-651d041d26amr8352432eaf.1.1761213312951; Thu, 23 Oct 2025 02:55:12 -0700 (PDT) MIME-Version: 1.0 References: <1791665551.452444.1761209220211.ref@mail.yahoo.com> <1791665551.452444.1761209220211@mail.yahoo.com> In-Reply-To: <1791665551.452444.1761209220211@mail.yahoo.com> From: Aleksander Alekseev Date: Thu, 23 Oct 2025 12:55:01 +0300 X-Gm-Features: AWmQ_bmc6LEK1pBK36L8gLNOy3oxfqLBXSgOPNPz2ZO0D4rOOqFHZcELfeOFWTQ Message-ID: Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions To: pgsql-hackers Cc: Sergey Prokhorenko Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Sergey, > I'm writing to propose adding two new built-in functions to PostgreSQL that provide compact UUID encoding using the base32hex format. Firstly, cc:'ing a few dozens of people is not the best way to get attention to your patch. Please don't do this. Secondly, in order to propose a patch please use `git format-patch` and send it as an attachment. Then register it on the nearest open commitfest [1]. The interface you are proposing is ugly and is not composable. The right way of doing this IMO would be: 1. Implement uuid -> bytea and bytea -> uuid casting 2. Implement encode(bytea, 'base32') and decode(text, 'base32') So the overall interface should be like this: SELECT encode(uuidv7() :: bytea, 'base32'); The value of converting uuid to base32 is not obvious though, so I would recommend explaining it in more detail. Consider starting a new thread for each separate patch. [1]: https://commitfest.postgresql.org/ -- Best regards, Aleksander Alekseev