How is a uuid
column ordered when used with ORDER BY
? Is it based on its string representation? I can't seem to find any documentation regarding this.
This function compares UUIDs in PostgreSQL:
/* internal uuid compare function */
static int
uuid_internal_cmp(const pg_uuid_t *arg1, const pg_uuid_t *arg2)
{
return memcmp(arg1->data, arg2->data, UUID_LEN);
}
So UUIDs are compared lexically byte for byte using the binary values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With