Skip to content

Takes a string encoded with the base-64 encoded rules nd returns the decoded result as a binary. The result is NULL if the argument is NULL or not a valid base-64 string.

func.from_base64(<expr>)
func.from_base64('YWJj')
┌──────────────────────────┐
│ func.from_base64('YWJj') │
├──────────────────────────┤
│ abc │
└──────────────────────────┘
FROM_BASE64(<expr>)
ArgumentsDescription
<expr>The string value.

BINARY

SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc')) as b, b::String;
┌───────────────────────────────────────┐
│ to_base64('abc') │ b │ b::string │
│ String │ Binary │ String │
├──────────────────┼────────┼───────────┤
│ YWJj │ 616263 │ abc │
└───────────────────────────────────────┘