Re: Sequence vs UUID

From: Miles Elam <miles(dot)elam(at)productops(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Sequence vs UUID
Date: 2023-01-29 05:02:47
Message-ID: CAALojA_+ar2YQcB7u+LGXEO_6P9j=Me-XQhMUvALa+=rYSGzXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 28, 2023 at 8:02 PM Ron <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> Then it's not a Type 4 UUID, which is perfectly fine; just not random.

Yep, which is why it really should be re-versioned to UUIDv8 to be
pedantic. In everyday use though, almost certainly doesn't matter.

> Also, should now() be replaced by clock_timestamp(), so that it can be
> called multiple times in the same transaction?

Not necessary. Instead of 122 bits of entropy, you get 106 bits of
entropy and a new incremented prefix every minute. now() vs
clock_timestamp() wouldn't make a substantive difference. Should still
be reasonably safe against the birthday paradox for more than a
century when creating more than a million UUIDs per second.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hirose shigeo (廣瀬 繁雄 □SWC○ACT) 2023-01-30 05:00:43 How to control pg_catalog results for each users?
Previous Message Ron 2023-01-29 04:02:36 Re: Sequence vs UUID