Binary Data Types
Table 1 lists the binary data types that can be used in GaussDB(DWS).
Name |
Description |
Storage Space |
---|---|---|
BLOB |
Binary large object. Currently, BLOB only supports the following external access interfaces:
For details about the interfaces, see DBMS_LOB.
NOTE:
Column storage cannot be used for the BLOB type. |
The maximum size is 10,7373,3621 bytes (1 GB - 8203 bytes). |
RAW |
Variable-length hexadecimal string
NOTE:
Column storage cannot be used for the raw type. |
4 bytes plus the actual hexadecimal string. The maximum size is 10,7373,3621 bytes (1 GB - 8203 bytes). |
BYTEA |
Variable-length binary string |
4 bytes plus the actual binary string. The maximum size is 10,7373,3621 bytes (1 GB - 8203 bytes). |
In addition to the size limitation on each column, the total size of each tuple is 8203 bytes less than 1 GB.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
--Create a table. CREATE TABLE blob_type_t1 ( BT_COL1 INTEGER, BT_COL2 BLOB, BT_COL3 RAW, BT_COL4 BYTEA ) DISTRIBUTE BY REPLICATION; --Insert data. INSERT INTO blob_type_t1 VALUES(10,empty_blob(), HEXTORAW('DEADBEEF'),E'\\xDEADBEEF'); -- Query data in the table. SELECT * FROM blob_type_t1; |
1 2 |
-- Delete the tables: 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot