Merged
Conversation
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Signed-off-by: Vincent Mercier <vincmer@amazon.com>
Collaborator
Author
|
@dverite as discussed during PostgreSQL meetup, the variant is not valid. This change do not brake existing partitioning as previous implementation was allowing invalid UUIDv7 and should not be used. However for sake of clarity, I'll add a migration script, but feel free to have a first look. |
dverite
approved these changes
Apr 9, 2026
Collaborator
dverite
left a comment
There was a problem hiding this comment.
LGTM
About it being a bug, it's not that bad. The uuid comparison function in postgres does not care about the semantics of the bit fields and the conformance to RFC9562.
So when partition boundaries have the variant bits to 00 instead of 10, aside from the fact that they cannot be passed directly to uuid_extract_timestamp(), it does not seem to make any significant difference for the rest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix variant field in UUIDv7 generated by PostgreSQL partition Manager
Why
PPM is currently generating UUIDv7 with variant field set to 0, which is reserved for Network Computing System (NCS) backward compatibility.
UUIDv7 should be use lowest variant as boundary for partition to comply with RFC9562. PostgreSQL implemented the RFC9562 and expect variant 8 (PostgreSQL 18 source code)
In current implementation, UUIDv7 are not valid so timestamp could not be extracted
With new implementation, PostgreQL built-in uuid_extract_timestamp() function correctly resolve UUIDv7 timestamp
How
Release
Release v1.2.0