Binary Types
Table 1 lists the binary types supported by GaussDB.
Name |
Description |
Storage Space |
---|---|---|
BLOB |
Binary large object (BLOB). Currently, BLOB only supports the following external access APIs:
For details about the APIs, see DBE_LOB. |
The maximum size is 32 TB (35,184,372,088,832 bytes). |
RAW |
Variable-length hexadecimal string. |
4 bytes plus the actual hexadecimal string. The maximum size is 1,073,733,621 bytes (that is, 1 GB minus 8,203 bytes). |
BYTEA |
Variable-length binary string. |
4 bytes plus the actual binary string. The maximum size is 1,073,733,621 bytes (that is, 1 GB minus 8,203 bytes). |

In addition to the size limitation on each column, the total size of each tuple cannot exceed 1,073,733,621 bytes (that is, 1 GB minus 8,203 bytes).
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
-- Create a table. openGauss=# CREATE TABLE blob_type_t1 ( BT_COL1 INTEGER, BT_COL2 BLOB, BT_COL3 RAW, BT_COL4 BYTEA ) DISTRIBUTE BY REPLICATION; -- Insert data. openGauss=# INSERT INTO blob_type_t1 VALUES(10,empty_blob(), HEXTORAW('DEADBEEF'),E'\\xDEADBEEF'); -- Query data in the table. openGauss=# SELECT * FROM blob_type_t1; bt_col1 | bt_col2 | bt_col3 | bt_col4 ---------+---------+----------+------------ 10 | | DEADBEEF | \xdeadbeef (1 row) -- Drop the table. openGauss=# DROP TABLE blob_type_t1; |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.