I need to convert a db value into base64encode. I tried:
select encode(cast(est_name as text),\'base64\') from establishments;
It showing
The encode function encodes from bytea to text.
encode
select encode(est_name::bytea, 'base64') from establishments;
http://www.postgresql.org/docs/current/static/functions-binarystring.html#FUNCTIONS-BINARYSTRING-OTHER