Re: UUID column as pimrary key? - Mailing list pgsql-general

From Scott Ribe
Subject Re: UUID column as pimrary key?
Date
Msg-id 64E36981-C1B1-44D2-9718-F1113431757E@elevated-dev.com
Whole thread Raw
In response to Re: UUID column as pimrary key?  (Chris Browne <cbbrowne@acm.org>)
List pgsql-general
On Jan 6, 2011, at 9:31 AM, Chris Browne wrote:

> The reasonable choices for a would-be artificial primary key seem to be
> 1 and 3; in a distributed system, I'd expect to prefer 1, as the time +
> host data are likely to eliminate the "oh, it might just randomly match"
> problem.

In some contexts, 1 is considered a security weakness, as it reveals information about which machine generated it and
when,which is why most OS-supplied uuid generators now default to 4 (random). This tends to be more of a concern with
encryption/securityuses, and if it's not a concern for your db[*], then your are correct that 1 is likely the best
choice.

[*] After all, in many dbs we log all sorts of explicit where/who/when for auditing purposes. In that case, having ids
thatprovide a clue of where/when most certainly does not add any legitimate security concern. 

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





pgsql-general by date:

Previous
From: Chris Browne
Date:
Subject: Re: UUID column as pimrary key?
Next
From: pasman pasmański
Date:
Subject: Pl/perl and perl version-tip in doc