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 1uaKOf-003s0B-A3 for pgsql-general@arkaria.postgresql.org; Fri, 11 Jul 2025 20:31: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 1uaKOc-00764Z-Rk for pgsql-general@arkaria.postgresql.org; Fri, 11 Jul 2025 20:31:03 +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 1uaKOc-00764Q-8h for pgsql-general@lists.postgresql.org; Fri, 11 Jul 2025 20:31:03 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uaKOb-006oqU-05 for pgsql-general@lists.postgresql.org; Fri, 11 Jul 2025 20:31:02 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-558fc8f0750so3039838e87.2 for ; Fri, 11 Jul 2025 13:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752265858; x=1752870658; 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=QEt6lnx/K2voFUrWz32hDkK0/HK2Qkjsd0xQT9B8zZY=; b=T18a6MAEC3sq80c/pczDHxbrMBdEI7sN2CeU5mHmtC+8T9qCQGPiaU+ovIIQifFJrk Ug4tUmWtyfT//hs1mEPwjUTeNCpxp8e3nF4Isv4irfQXFxYluYDhniWwsnI9zL6WQb/j jFj2Y49ug+mva77eX9sSw6CGjjSm6cmCN1KjPVEY98Six3IjKYZ5gTuWLNgDFlrOsTBn Hshn7dwNzgJHb8JklA940JIS6J5XYEnq7lF6EUvJmosS3O1Neea2DV0pAJXpqEYJUIog EYwznXLaXIq0lIO5qW+9o/hbGnxEAhu1mqdlMXepmPKC9XCxc9wiopFbUXV+FPoMBtPu 6TNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752265858; x=1752870658; 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=QEt6lnx/K2voFUrWz32hDkK0/HK2Qkjsd0xQT9B8zZY=; b=McwLrfKLodduaxUFXiUC39/TWTYLGposLTVN818ErEIWqdVfXmmvfGqIOS/SEHblAC nAnQCm4TUPamfFIkjRcvB4i8BitrZG6iR6Xn0lTkj55SxJ6nyl2+y+PV+0Nv2nIaoNuc 8LHPMpDom3WnqoCNobPq+m7TzxvFMeSBEoVsqb5fZS6iwTiWHGhkAWGL+uaka+P9ZxK5 7gk2Ta+aeNE70H821hRUH7GBXI3xG/XQgQtnRfKweuonpO5djW7O3DgGbEX3IAzDet+5 ENXuxok0R0ughhvNK2yZejpSnnqt/mFB+hW/0Hrej3146L71gMcgymtWUTZTjbsHlOXS xPMA== X-Forwarded-Encrypted: i=1; AJvYcCX477lxbZU5LXs3G1vMZvNQaJrcTG7E3PpzeZPgoVHsgHtwY457+E3qUdCCJpkI/bEHX2nXCR5sVkkmwVwt@lists.postgresql.org X-Gm-Message-State: AOJu0Yx93WY2i4cYXI58+HK6XyGYo51OH00PW41HvSUHW4Sk+YXxvr+d TV2QwDMIAT2jmqJpKKdA7Q2cor8U0eQlebmNfybhCapQBToWaOyGCauyJWfFDFAF5Lhqjpp2bjk 27Vo768YvBfrRNb2S4zM/6XmpquhHDbM= X-Gm-Gg: ASbGncuhOuk4p9IwpRzNqs6Y4SMlBmGVLf0Q1PFToJqjl0whXSS96ILZ3cxkoveazwG FzdYE8JllFR5FWCq3ogt0YZCKCvpsm0pSd6nJmtWzeqUP/wS5KOreYL1qOGUMoTs0yLIu9dD1Q4 Vdx9Sjey4SsgIL5+uy67jvr4Eh148tRbPhYI/c5mc/xPSf8b1jcI0NeWDzHI6v3mguJEskEsyYC KbJ7ew= X-Google-Smtp-Source: AGHT+IGXzbx2O01OI95EkhMBDtJdovBnf0CHP9M0XcltHyZFeC/n0n1klYJQK3NO5ZCJdU3b9I3k2TEUTkdqGSYagHY= X-Received: by 2002:a05:6512:2214:b0:553:2e37:6952 with SMTP id 2adb3069b0e04-55a04655e1amr1621426e87.55.1752265857489; Fri, 11 Jul 2025 13:30:57 -0700 (PDT) MIME-Version: 1.0 References: <7f90e1f3-7e0b-4b87-8cb6-f2862755fd3c@aklaver.com> In-Reply-To: From: Merlin Moncure Date: Fri, 11 Jul 2025 14:30:45 -0600 X-Gm-Features: Ac12FXz5FCkzE_HEBzb-EZonVsOE467-hg4QXeCpl3bmb3bkLYI5BESGgj-Kkcw Message-ID: Subject: Re: Aggregate versions of hashing functions (md5, sha1, etc...) To: Dominique Devienne Cc: Florents Tselai , Adrian Klaver , pgsql-general Content-Type: multipart/alternative; boundary="000000000000fce0f00639ad2ff6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fce0f00639ad2ff6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 11, 2025 at 10:17=E2=80=AFAM Dominique Devienne wrote: > On Fri, Jul 11, 2025 at 6:05=E2=80=AFPM Florents Tselai > wrote: > > On Fri, Jul 11, 2025, 18:27 Adrian Klaver > wrote: > >> [...] create an extension that incorporates the code. > > > > That's an ideal use case for an extension indeed . > > Extensions are of no use to me, unfortunately, unless built-in and > official. So if I have to wait for v19, so be it. But the ball has to > get rolling at least. > Right -- exactly. The problem is cloud providers do not allow 3rd party extensions. You can work around this if your extensions are available at the SQL level, or can be built with standard extensions. Candidly, it's going to be tough sledding to get your needs incorporated into contrib. I'm not saying it wont happen -- let's just say holding breath until solution is not advisable. I know exactly where you're at. This is why I built an SQL available extension that does lz4 compression; it's the only way to compress data locally before sending it out to AWS via the s3 API. Aside: This may be an unpopular position, but I think the postgres extension system is useless for 3rd party contributions until there is some way to introduce items in the vein of npm, pip, etc. I think the only short term path I know of: 1. write or find a C library that does something similar to what you need 2. compile that to plv8 with emscriptem 3. Wrap with plv8 function handlers Getting it to reasonable performance is possible if you compile WASM and work out amortizing start up costs. However, due to how plv8 and emscripten interact from memory standpoint, there's a lot of copying to move memory in/out, and you will have to work under a manageable buffer size, say 1mb. If you're curious I can take you through it. merlin --000000000000fce0f00639ad2ff6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jul 11, 2025 at 10:17=E2=80=AFAM = Dominique Devienne <ddevienne@gma= il.com> wrote:
On Fri, Jul 11, 2025 at = 6:05=E2=80=AFPM Florents Tselai
<florents= .tselai@gmail.com> wrote:
> On Fri, Jul 11, 2025, 18:27 Adrian Klaver <adrian.klaver@aklaver.com> wr= ote:
>> [...] create an extension that incorporates the code.
>
> That's an ideal use case for an extension indeed .

Extensions are of no use to me, unfortunately, unless built-in and
official. So if I have to wait for v19, so be it. But the ball has to
get rolling at least.

Right -- exactly.= =C2=A0 =C2=A0The problem is cloud providers=C2=A0do not allow 3rd party ext= ensions.=C2=A0 You can work around this if your extensions are available at= the SQL level, or can be built with standard extensions.=C2=A0=C2=A0
=

Candidly, it's going to be tough sledding to get yo= ur needs incorporated into contrib.=C2=A0 =C2=A0I'm not saying it wont = happen -- let's just say holding breath until solution is not advisable= .=C2=A0 I know exactly where you're at.=C2=A0=C2=A0

This is why I built an SQL available extension that does lz4 compress= ion; it's the only way to compress data locally before sending it out t= o AWS via the s3 API.=C2=A0=C2=A0

Aside: This may = be an unpopular position, but I think the postgres extension system is usel= ess for 3rd party contributions until there is some way to introduce items = in the vein of npm, pip, etc.

=C2=A0I think the on= ly short term path I=C2=A0know of:
1. write or find a C library t= hat does something similar to what you need
2. compile that to pl= v8 with emscriptem
3. Wrap with plv8 function handlers
=
Getting it to reasonable performance is possible if you comp= ile WASM and work out amortizing start up costs. However, due to how plv8 a= nd emscripten=C2=A0interact from memory standpoint, there's a lot of co= pying to move memory in/out, and you will have to work under a manageable b= uffer size, say 1mb.=C2=A0 If you're curious I can take you through it.=

merlin
--000000000000fce0f00639ad2ff6--