In PostgreSQL, BLOB (Binary Large Object) is not a native data type. However, PostgreSQL provides similar functionality through the BYTEA data type which is used to store binary data. More: PostgreSQL BYTEA (BLOB).
| Type in PostgreSQL | Maximum size |
|---|---|
BYTEA | up to 1 GB - the usual choice |
OID + large object | up to 4 TB, read and written with lo_import / lo_export |
PostgreSQL has no BLOB or CLOB type names either: binary goes in `BYTEA` and characters go in `TEXT`. Both reach 1 GB. Only if you genuinely need multi-terabyte objects should you turn to OID-based large objects.
TOAST usually bites first: any value over roughly 2 KB is compressed and moved into a side table. The 1 GB type limit is rarely reached, but TOAST has a visible cost in read performance and backup size.
pg_dump -Fc (custom format restores bytea correctly) or COPY ... TO ... WITH (FORMAT binary)pg_restore, or COPY ... FROM ... WITH (FORMAT binary)pg_dump writes bytea as \x... hex literals, so the dump balloons - use -Fc when moving data between serversCOPY ... WITH (FORMAT binary) records the platform byte order in the file header, so restoring on a different architecture fails\x hex input/output form for BYTEA relies on standard_conforming_strings = on, which is the modern default