OceanBase Database supports BLOB data types and TEXT data types.
The following table describes the supported BLOB and TEXT data types in detail.
| Type | Fixed/Variable length | Maximum storage length (bytes) | Character set |
|---|---|---|---|
TINYBLOB |
Variable | 255 | BINARY |
BLOB |
Variable | 65,535 | BINARY |
MEDIUMBLOB |
Variable | 16,777,215 | BINARY |
LONGBLOB |
Variable | 536,870,910 | BINARY |
TINYTEXT |
Variable | 256 | UTF8MB4 |
TEXT |
Variable | 65,535 | UTF8MB4 |
MEDIUMTEXT |
Variable | 16,777,215 | UTF8MB4 |
LONGTEXT |
Variable | 536,870,910 | 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.