Re: Using varchar primary keys.

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Samantha Atkins <sjatkins(at)me(dot)com>
Cc: Joe Van Dyk <joe(at)tanga(dot)com>, Tim Uckun <timuckun(at)gmail(dot)com>, jesusthefrog <jesusthefrog(at)gmail(dot)com>, Jasen Betts <jasen(at)xnet(dot)co(dot)nz>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using varchar primary keys.
Date: 2013-04-02 19:37:10
Message-ID: CAHyXU0w92QdgdK+zpwRTi+3oLrHvpRcsW1EQ_6rY84hXeE7WXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 2, 2013 at 2:01 PM, Samantha Atkins <sjatkins(at)me(dot)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 means that very nice things like dynamic relationships and persistent collections of references to multiple types of things cannot 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2013-04-02 19:45:10 Re: create temporary table problem
Previous Message Gavin Flower 2013-04-02 19:17:24 Re: Money casting too liberal?