OceanBase Database supports the large object data type BLOB and the text data type TEXT.
The following table describes the large object and text types supported in the current version of OceanBase Database and their related information.
| Type | Length | Maximum Storage Length (Bytes) | Character Set |
|---|---|---|---|
TINYBLOB |
Variable | 255 | BINARY |
BLOB |
Variable | 65535 | BINARY |
MEDIUMBLOB |
Variable | 16777215 | BINARY |
LONGBLOB |
Variable | 536870910 | BINARY |
TINYTEXT |
Variable | 256 | UTF8MB4 |
TEXT |
Variable | 65535 | UTF8MB4 |
MEDIUMTEXT |
Variable | 16777215 | UTF8MB4 |
LONGTEXT |
Variable | 536870910 | UTF8MB4 |
STRING
NoteFor OceanBase Database V4.3.5, the text data type |
Variable | 16777216 | UTF8MB4 |
In most cases, you can treat BLOB columns as VARBINARY columns and TEXT columns as VARCHAR columns. BLOB and TEXT/STRING differ from VARBINARY and VARCHAR in the following aspects:
You must specify the index prefix length for
BLOBandTEXTcolumns. ForCHARandVARCHAR, the prefix length is optional.BLOBandTEXT/STRINGcolumns cannot haveDEFAULTvalues.
