Skip to content

Instantly share code, notes, and snippets.

@jpetitcolas
Created July 10, 2013 16:37
  • Star 31 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Encode/decode a base64 encoded string in PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
Copy link

ghost commented Aug 21, 2020

Thank you ! it was helpful.

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