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 1uaGFz-002rea-ID for pgsql-general@arkaria.postgresql.org; Fri, 11 Jul 2025 16:05:51 +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 1uaGFx-006Azc-DV for pgsql-general@arkaria.postgresql.org; Fri, 11 Jul 2025 16:05:50 +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 1uaGFw-006AzT-Ui for pgsql-general@lists.postgresql.org; Fri, 11 Jul 2025 16:05:49 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uaGFv-006muZ-2O for pgsql-general@lists.postgresql.org; Fri, 11 Jul 2025 16:05:48 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-b2c4e46a89fso2070206a12.2 for ; Fri, 11 Jul 2025 09:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752249946; x=1752854746; darn=lists.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=2RMHxeeKzmV/t0qTkAbolpzlFmS167M5I+I1mZo+zN8=; b=GoPEJDf03/oKEbguvWcjl0lQ+kRs71CD0MSAZtrrmujPHrn4ptDTOy/2w0jPJ6ng+4 hUmDarOefx2/5xS2XXvZFw44CXQExSXvwvcXeJulcAlWbsl+ca1JpkjMgrp+KfDpAfMg ReoiZe1gx8DKPXJUaGltoUN7fRFBX3VXSA5i2LjJzZDsOSHci7SpDmeChoCcsqnCkpep F/Yr4/xYJgcpIZP2LaHipBk5OD/frgFLqWIxy0taQ0T8qbElXtdoIh/Gr9QJYtTS8Zxz f2F4wHpqeQYCNbnw8Qo+zF5lXT330hbebmBrPWOBRXsbH7bM/II4OTt8JA1QsoAg/iFQ Uuew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752249946; x=1752854746; 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=2RMHxeeKzmV/t0qTkAbolpzlFmS167M5I+I1mZo+zN8=; b=FJqC9LtEpufPVtu2yiygtwix/GQpwwaFwbBbbsgKbUffbYWWsL3a3mL/VyoWyL4j6x I7RaZ1YecE/Mal4np5sy0YyF0dUzvVkwvIXMrZ08LXz0VerxOg/bnRUUMimaQKZJMR1D UdOed4xzw1HIInopCcGZ6IwnM28aWJfA5nZbEhoKmpmHE2wEakFMjDYQs8gddhMsRMXV O1n7R3oVINSHOaFmso/5TWvmR9Wy9wUxvQYyZzKseZca2461LslrEppEJ2/TsRu36Ole jjvBHvNabighPFvgsa7DBOzdlovsLO2rOQ8nlRbhfvg9CpiG1g9RB25yThrDf441lj5K P9ZA== X-Forwarded-Encrypted: i=1; AJvYcCUV2n1QOmSD6b9ZUxaXEHEj+y3ETrxz3GtEiz9zni9Qf5iTV96992jqG0NPZorwHXggrid5JlqGXjMFybAD@lists.postgresql.org X-Gm-Message-State: AOJu0YyQ0lvNmoEisVoSdJ9sXmpKfvADC6xkEZYqJQOuPU+kdHkB4YQQ qu5pXKdAMDI4Npi/RrDWbECTyRiFNrndK1tMMp+Ntpn7Z+2X+MriwzCBGT//CyL5CVmLEkfIrUL wx4wISRTTSVh4JdyNJt08rx0IpKYUyMk= X-Gm-Gg: ASbGncslvr+utQ6ycTajJ4eKEdwu0QOj533f1BYbX2FI/an6bSOr2po1UuepRKYpPyp XQDhJRrriODUX20cxzIlXzho427A6zq7698zb7mQ0x6feKhaREcIVyvkM4sV5M97I3IaZDm7eUu YlEay2TMAjIs9RE+N0Apyy11qzkH8tBMIghsOlBc7knOowodHtxs6JiVnAAVm8auyn6+BpV/VlG CFfwPp0/le22yY8 X-Google-Smtp-Source: AGHT+IEi2hg368M6Bl3y/J4PrZFEzvA7DWsY6goT+wBWjAWpz2tVZBoSLpyQiZs8VVbtC8ax2HggY/lZaWmWbGjevzk= X-Received: by 2002:a17:90b:4cc5:b0:311:b413:f5e1 with SMTP id 98e67ed59e1d1-31c4cd13933mr4785304a91.32.1752249946191; Fri, 11 Jul 2025 09:05:46 -0700 (PDT) MIME-Version: 1.0 References: <7f90e1f3-7e0b-4b87-8cb6-f2862755fd3c@aklaver.com> In-Reply-To: From: Florents Tselai Date: Fri, 11 Jul 2025 19:03:31 +0300 X-Gm-Features: Ac12FXzpKO5da5ZcrC9_lgC7NUL3LGr3A4jqzTakOrpjh9V6yq0AtA4UvN0PGnc Message-ID: Subject: Re: Aggregate versions of hashing functions (md5, sha1, etc...) To: Adrian Klaver Cc: Dominique Devienne , pgsql-general Content-Type: multipart/alternative; boundary="00000000000099bb2d0639a97bd8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000099bb2d0639a97bd8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 11, 2025, 18:27 Adrian Klaver wrote= : > On 7/11/25 01:49, Dominique Devienne wrote: > > On Thu, Jul 10, 2025 at 6:25=E2=80=AFPM Adrian Klaver > wrote: > >> On 7/10/25 04:48, Dominique Devienne wrote: > >>> Seems so logical to me, that these hashing functions were available > >>> are aggregates, I can't be the first one to think of that, can it? > >> > >> I've been on this list since late 2002 and I don't recall this ever > >> being brought up. Now it is entirely possible that age has dimmed my > >> recall abilities:) Though a quick search seems to confirm my memory. > > > > Hi. Given that [SQLite's SHA3 hasher][1] has it (OK, for [8 months > only][2]), > > it's hardly an original idea. And when considering that `sha3_query` > > (and `sha1_query` before it) have been there for years, and provide > > equivalent functionality, again, this is not novel by any stretch of > > the imagination. > > Even if there was interest in writing the code, given that Postgres 18 > is in Beta I don't see this happening for it's release. That means the > earliest it would arrive would be Fall of 2026. The alternative would be > to do like Sqlite and create an extension that incorporates the code. > That's an ideal use case for an extension indeed . @Dominique I'd suggest searching for these function on GitHub, just in case there are already implementations out there. I've seen a lot of weird aggregates out there for niche cases. If not, it might be an interesting weekend project for me to explore. > --00000000000099bb2d0639a97bd8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Jul 11, 2025, 18:27 Adri= an Klaver <adrian.klaver@ak= laver.com> wrote:
On 7/11/= 25 01:49, Dominique Devienne wrote:
> On Thu, Jul 10, 2025 at 6:25=E2=80=AFPM Adrian Klaver <adria= n.klaver@aklaver.com> wrote:
>> On 7/10/25 04:48, Dominique Devienne wrote:
>>> Seems so logical to me, that these hashing functions were avai= lable
>>> are aggregates, I can't be the first one to think of that,= can it?
>>
>> I've been on this list since late 2002 and I don't recall = this ever
>> being brought up. Now it is entirely possible that age has dimmed = my
>> recall abilities:) Though a quick search seems to confirm my memor= y.
>
> Hi. Given that [SQLite's SHA3 hasher][1] has it (OK, for [8 months= only][2]),
> it's hardly an original idea. And when considering that `sha3_quer= y`
> (and `sha1_query` before it) have been there for years, and provide > equivalent functionality, again, this is not novel by any stretch of > the imagination.

Even if there was interest in writing the code, given that Postgres 18
is in Beta I don't see this happening for it's release. That means = the
earliest it would arrive would be Fall of 2026. The alternative would be to do like Sqlite and create an extension that incorporates the code.

That&#= 39;s an ideal use case for an extension indeed .
@Dominique I'd suggest searching for these fun= ction on GitHub, just in case there are already implementations out there.= =C2=A0
I've seen a lot of weird aggregates out t= here for niche cases.

If= not, it might be an interesting weekend project for me to explore.
--00000000000099bb2d0639a97bd8--