type

BYTEA

PostgreSQL BYTEA holds arbitrary bytes including zero bytes; unlike text, it is not constrained by character encoding. Example target: PostgreSQL 17. Run in a disposable database; examples need no existing tables.

Formal Syntax & Structure

sql syntaxsql
BYTEA

Working Example

Example Snippetsql
SELECT encode(decode('0041ff','hex'),'hex');
SQL Reference