Re: Can we get sha* function over text, that could be used in index?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can we get sha* function over text, that could be used in index?
Date: 2026-02-18 15:07:22
Message-ID: CANzqJaD7mjDcXKNcESLJ+oOd0GDZQvCc45hvGc7LD+zW9COKUg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 18, 2026 at 9:58 AM hubert depesz lubaczewski <depesz(at)depesz(dot)com>
wrote:

> Hi,
> So, we have various sha* functions.
>
> And I recently got asked about using them as a based for unique index
> over long texts.
> Normally one would do it with md5(text), but the person asking wanted to
> use sha().

I think I'd push back, asking them if they really need
cryptographically-secure hashing (which they most probably don't).

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Linus Heckemann 2026-02-18 18:02:10 Re: Can we get sha* function over text, that could be used in index?
Previous Message hubert depesz lubaczewski 2026-02-18 14:58:36 Can we get sha* function over text, that could be used in index?