Last active
December 23, 2022 02:13
-
-
Save cdmckay/a82261e48a42a3bbd78a to your computer and use it in GitHub Desktop.
How to convert a PostgreSQL UUID to bytea
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
select decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex'); | |
-- And here's how to convert it to the ShortUUID format used in Process Street | |
select replace(encode(substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 9 for 8) || | |
substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 1 for 8), 'base64'), '=', ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@will any idea what the use case for
void_send
would be? how is it even called?