Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD

From: Matteo Beccati <php(at)beccati(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD
Date: 2014-05-26 17:51:25
Message-ID: 53837F1D.3030500@beccati.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26/05/2014 19:31, Andres Freund wrote:
> On 2014-05-26 13:25:49 -0400, Tom Lane wrote:
>> Matteo Beccati <php(at)beccati(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-05-26 17:53:02 Re: Allowing line-continuation in pgbench custom scripts
Previous Message Jeff Janes 2014-05-26 17:50:03 Re: Allowing line-continuation in pgbench custom scripts