Re: UUID v7 - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: UUID v7
Date
Msg-id CAJ7c6TOAk9+9Y4o3gowNxK9hVpBOV+QFqZMzMsw5DneD4yQqvg@mail.gmail.com
Whole thread Raw
In response to Re: UUID v7  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Responses Re: UUID v7
Re: UUID v7
List pgsql-hackers
Hi,

> Function to extract timestamp does not provide any guarantees at all. Standard states this, see Kyzer answers
upthread.
> Moreover, standard urges against relying on that if uuidX was generated before uuidY, then uuidX<uuid. The standard
isdoing a lot to make this happen, but does not guaranty that. 
> All what is guaranteed is the uniqueness at certain conditions.
>
> > Otherwise you can calculate crc64(X) or sha256(X)
> > internally in order to generate an unique ID and claim that it's fine.
> >
> > Values that violate named invariants should be rejected with an error.
>
> Think about the value that you pass to uuid generation function as an entropy. It’s there to ensure uniqueness and
promoteordering (but not guarantee). 

If the standard doesn't guarantee something it doesn't mean it forbids
us to give stronger guarantees. I'm convinced that these guarantees
will be useful in real-world applications, at least the ones acting
exclusively within Postgres.

This being said, I understand your point of view too. Let's see what
other people think.

--
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: pgbnech: allow to cancel queries during benchmark
Next
From: Bharath Rupireddy
Date:
Subject: Re: Remove redundant HandleWalWriterInterrupts()