Skip to content

implement DatumPass, Element and Scalar for Uuid#2358

Open
ibotty wants to merge 1 commit into
pgcentralfoundation:developfrom
ibotty:add-uuid-scalar-impl
Open

implement DatumPass, Element and Scalar for Uuid#2358
ibotty wants to merge 1 commit into
pgcentralfoundation:developfrom
ibotty:add-uuid-scalar-impl

Conversation

@ibotty

@ibotty ibotty commented Jul 15, 2026

Copy link
Copy Markdown

fixes #2357

Comment thread pgrx/src/datum/borrow.rs Outdated
Comment on lines +123 to +125
// Uuid is a fixed 16-byte, char-aligned, by-ref type stored inline in arrays with no
// header and no byte-swapping, so the macro's size>Datum big-endian branch (ptr.cast()) is
// correct for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this editorialization is unnecessary

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Will remove both.

Comment thread pgrx/src/array.rs Outdated
Comment on lines +441 to +443
// Uuid is a fixed 16-byte `[u8; 16]` (no padding, all bitpatterns valid). Postgres stores `uuid`
// inline in arrays as packed, char-aligned raw bytes with no per-element header and no endian
// byte-swapping, so `&[Uuid]` matches the array data layout on both LE and BE.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is this.

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see my comments

@ibotty
ibotty force-pushed the add-uuid-scalar-impl branch from e7b1707 to 4bdd9b2 Compare July 15, 2026 16:54
@ibotty

ibotty commented Jul 15, 2026

Copy link
Copy Markdown
Author

I think the change is semantically correct, but I am no expert in PostgreSQL. I mostly went from Uuid (in PostgreSQL) is basically a i128 (and I am using it as that at times) to this should definitely work. I only briefly looked into the PostgreSQL code myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uuid could support Scalar, DatumPass and Element

2 participants