OceanBase Database supports BLOB data types and TEXT data types.
The following table describes the supported BLOB and TEXT data types in detail.
| Type | Length | Maximum storage length (bytes) | Character sets |
|---|---|---|---|
TINYBLOB |
Variable | 255 | BINARY |
BLOB |
Variable | 65,536 (64 KB) | BINARY |
MEDIUMBLOB |
Variable | 16,777,216 (16 MB) | BINARY |
LONGBLOB |
Variable | 50,331,648 (48 MB) | BINARY |
TINYTEXT |
Variable | 256 | UTF8MB4 |
TEXT |
Variable | 65,536 (64 KB) | UTF8MB4 |
MEDIUMTEXT |
Variable | 16,777,216 (16 MB) | UTF8MB4 |
LONGTEXT |
Variable | 50,331,648 (48 MB) | UTF8MB4 |
In most cases, you can treat a BLOB column as a VARBINARY column, and treat a TEXT column as a VARCHAR column. However, the BLOB and TEXT types are different with the VARBINARY and VARCHAR types in the following aspects:
You must specify the length of the index prefix of a
BLOBorTEXTcolumn. This is optional for theCHARandVARCHARcolumns.A
BLOBorTEXTcolumn cannot have aDEFAULTvalue.