Re: Sequence vs UUID - Mailing list pgsql-general

From Miles Elam
Subject Re: Sequence vs UUID
Date
Msg-id CAALojA_+ar2YQcB7u+LGXEO_6P9j=Me-XQhMUvALa+=rYSGzXQ@mail.gmail.com
Whole thread Raw
In response to Re: Sequence vs UUID  (Ron <ronljohnsonjr@gmail.com>)
Responses Re: Sequence vs UUID
List pgsql-general
On Sat, Jan 28, 2023 at 8:02 PM Ron <ronljohnsonjr@gmail.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.



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Sequence vs UUID
Next
From: hirose shigeo(廣瀬 繁雄 □SWC○ACT)
Date:
Subject: How to control pg_catalog results for each users?