PostgreSQL BLOB Tools - Import, Export, View and Edit

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).

PostgreSQL BLOB - type family and size limits

Type in PostgreSQLMaximum size
BYTEAup to 1 GB - the usual choice
OID + large objectup to 4 TB, read and written with lo_import / lo_export

BLOB versus CLOB in PostgreSQL

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.

What limits you first

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.

BLOB from the command line

Things that bite with BLOB in PostgreSQL