Re: Using varchar primary keys. - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Using varchar primary keys.
Date
Msg-id CAHyXU0w92QdgdK+zpwRTi+3oLrHvpRcsW1EQ_6rY84hXeE7WXA@mail.gmail.com
Whole thread Raw
In response to Using varchar primary keys.  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Using varchar primary keys.
List pgsql-general
On Tue, Apr 2, 2013 at 2:01 PM, Samantha Atkins <sjatkins@me.com> wrote:
> Natural keys are in user data space.  Thus they are not guaranteed invariant and therefore cannot serve as persistent
identity.

That is true, but irrelevant in most real world cases.  Also, nothing
is keeping you from using an extra marker if/when you need to provide
an invariant lookup.

> Also natural keys have the considerable defect of being of different type and arity per logical entity type.   This
meansthat very nice things like dynamic relationships and persistent collections of references to multiple types of
thingscannot be built.  It also increases ORM  and data cache complexity. 

OO evangelism.

> These are considerable weaknesses.
>
> You cannot guess a uuid from say uuid.uuid4().  If you think you can I look forward to seeing your proof.

I never claimed that.  I said that postgresql random() can be guessed,
which it can, since it's based on lrand48.

merlin


pgsql-general by date:

Previous
From: Gavin Flower
Date:
Subject: Re: Money casting too liberal?
Next
From: Jerry Sievers
Date:
Subject: Re: create temporary table problem