On 26/05/2014 19:31, Andres Freund wrote:
> On 2014-05-26 13:25:49 -0400, Tom Lane wrote:
>> Matteo Beccati <php@beccati.com> writes:
>>> I'm attaching v2 of the patch. Here's a list of changes from v1:
>>
>>> * Restored --with-ossp-uuid. Configure tries ossp support first, then
>>> falls back to Linux and BSD variants
>
> Imo should be the other way round.
My goal was to avoid changing the underlying implementation if someone
has the ossp library installed. Tom is suggesting to split the configure
switch in two, so I guess that would allow the most flexibility.
>>> * md5.o and sha1.o are linked only when not using the ossp library
>
> The backend already has a md5 implementation, no?
Yes, but as far as I could see it can only convert a string to hash.
Making it fit the uuid use case would require concatenating the
namespace and source string before passing it to the md5 function. The
BSD system and pgcrypto implementations do not:
https://github.com/mbeccati/postgres/blob/ossp/contrib/uuid-ossp/uuid-ossp.c#L237
We could even use the system md5 and sha1 on BSD, but I've spotted at
least a difference between FreeBSD and NetBSD (sha.h vs sha1.h and
different function names) and I didn't think it was worth to pursue
that, especially if beta2 is the target.
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/