Re: sha1, sha2 functions into core?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sha1, sha2 functions into core?
Date: 2011-08-11 08:08:31
Message-ID: CABUevEzBDvh_gDFu+rviMYjS4BhJXrwXXkGQh6m0WcLW92jNtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 11, 2011 at 09:06, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On ons, 2011-08-10 at 14:19 -0400, Tom Lane wrote:
>> > 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,
>>
>> ... which this approach would create, because digest() isn't
>> restricted
>> to just those algorithms.  I think it'd be better to just invent two
>> new functions, which also avoids issues for applications that
>> currently
>> expect the digest functions to be installed in pgcrypto's schema.
>
> I would also prefer to simply add sha1(bytea/text) => bytea, but the
> existing md5 function is md5(bytea/text) => test, so either the new
> functions would be inconsistent, or we make the new functions broken
> like the old one, or we invent a different naming system, such as
> digest().

You could always combine them and create digest_sha1(bytea/text) =>
bytea, etc. That still won't have the "open ended" problem of just
digest().

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2011-08-11 09:12:51 Re: XMLATTRIBUTES vs. values of type XML
Previous Message Alexander Korotkov 2011-08-11 07:35:46 Re: WIP: Fast GiST index build