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

Ron Johnson <ronljohnsonjr@gmail.com>

From: Ron Johnson <ronljohnsonjr@gmail.com>
To: pgsql-general mailing list <pgsql-general@postgresql.org>
Date: 2026-02-18T15:07:22Z
Lists: pgsql-general
On Wed, Feb 18, 2026 at 9:58 AM hubert depesz lubaczewski <depesz@depesz.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!