Decode binary data from string previously encoded with encode. Parameter type is same as in encode.
decode(string text, type text)
text - The String to be decoded
text - Decoding type
bytea - Returns the Base64 decoded version of text.
select decode('YmFzZTY0IGVuY29kZWQgc3RyaW5n', 'base64');
---------------------------
base64 encoded string