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