Postgresql base64 encode

后端 未结 1 1608
抹茶落季
抹茶落季 2021-01-11 21:06

I need to convert a db value into base64encode. I tried:

 select encode(cast(est_name as text),\'base64\') from establishments;

It showing

相关标签:
1条回答
  • 2021-01-11 21:41

    The encode function encodes from bytea to text.

    select encode(est_name::bytea, 'base64') 
    from establishments;
    

    http://www.postgresql.org/docs/current/static/functions-binarystring.html#FUNCTIONS-BINARYSTRING-OTHER

    0 讨论(0)
提交回复
热议问题