I would use a ULID rather than thread ID.
They (and others) are great for this kind of case - and many others.
They (and others) are great for this kind of case - and many others.
There is also a draft to make a new uuid variant – uuid v7 – that will be very similar to how ulid works.
https://www.ietf.org/archive/id/draft-peabody-dispatch-new-u...
How? UUID is a structured format so the only options I can see is ulid creating their own unregistered uuid variant (probably a terrible idea) or adding ulid support to postgres (nothing to do with uuid).