Skip to content

Instantly share code, notes, and snippets.

@wirekang
Created November 13, 2023 01:55
Show Gist options
  • Save wirekang/bd7f24a34aefee402206a3959b846c8c to your computer and use it in GitHub Desktop.
Save wirekang/bd7f24a34aefee402206a3959b846c8c to your computer and use it in GitHub Desktop.
Postgres text to md5 bytea function
create or replace function "md5_bytea"(text) returns bytea as
$$
select decode(md5($1), 'hex');
$$
language sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment