Documentation / SQL / Functions
Blob Functions
This section describes functions and operators for examining and manipulating blob values.
| Description | BLOB concatenation. |
| Example | '\xAA'::BLOB || '\xBB'::BLOB |
| Result | \xAA\xBB |
| Description | Convert BLOB to VARCHAR. Fails if blob is not valid UTF-8. |
| Example | decode('\xC3\xBC'::BLOB) |
| Result | ü |
| Description | Convert VARCHAR to BLOB. Converts UTF-8 characters into literal encoding. |
| Example | encode('my_string_with_ü') |
| Result | my_string_with_\xC3\xBC |
| Description | Number of bytes in VARCHAR. |
| Example | octet_length('\xAA\xBB'::BLOB) |
| Result | 2 |
| Description | Returns the content from source (a filename, a list of filenames, or a glob pattern) as a BLOB. See the read_blob guide for more details. |
| Example | read_blob('hello.bin') |
| Result | hello\x0A |
© 2025 DuckDB Foundation, Amsterdam NL