Re: sha1, sha2 functions into core?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sha1, sha2 functions into core?
Date: 2011-08-10 18:24:23
Message-ID: 4E42CCD7.6050901@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/10/2011 02:06 PM, Peter Eisentraut wrote:
> I would like to see whether there is support for adding sha1 and sha2
> functions into the core. These are obviously well-known and widely used
> functions, but currently the only way to get them is either through
> pgcrypto or one of the PLs. We could say that's OK, but then we do
> support md5 in core, which then encourages people to use that, when they
> really shouldn't use that for new applications. Another weirdness is
> that md5() doesn't return bytea but instead the result hex-encoded in a
> string, which makes it weird to use in some cases.
>
> One thing that might be reasonable would be to move the digest()
> functions
>
> digest(data text, type text) returns bytea
> digest(data bytea, type text) returns bytea
>
> from pgcrypto into core, so that pgcrypto is mostly restricted to
> encryption, and can be kept at arm's length for those who need to do
> that.
>
> (Side note: Would the extension mechanism be able to easily cope with a
> move like that?)
>

It's come up before:
<http://archives.postgresql.org/pgsql-hackers/2009-09/msg01293.php>

+1 for returning bytea though.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-10 18:26:26 Re: sha1, sha2 functions into core?
Previous Message Magnus Hagander 2011-08-10 18:21:38 Re: longstanding mingw warning