BASE64_ENCODE v16
Use the BASE64_ENCODE
function to translate and encode a string in Base64 format, as described in RFC 4648. This function can be useful when composing MIME
email that you intend to send using the UTL_SMTP
package. The BASE64_ENCODE
function has two signatures:
and
This function returns a RAW
value or an OID
.
Parameters
r
r
specifies the RAW
string to translate to Base64.
loid
loid
specifies the object ID of a large object to translate to Base64.
Examples
Before executing the example, invoke the command:
This command instructs the server to escape any nonprintable characters and to display BYTEA
or RAW
values onscreen in readable form. For more information, see the Postgres core documentation.
This example first encodes a string that contains the text abc
using BASE64_ENCODE
and then decodes the string using BASE64_DECODE
:
- On this page
- Parameters
- Examples