A Character Large OBject (or CLOB) is part of the SQL:1999 standard data types. It is a collection of
character
Character or Characters may refer to:
Arts, entertainment, and media Literature
* ''Character'' (novel), a 1936 Dutch novel by Ferdinand Bordewijk
* ''Characters'' (Theophrastus), a classical Greek set of character sketches attributed to The ...
data in a
database management system
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases span ...
, usually stored in a separate location that is referenced in the table itself.
Oracle
An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination.
Description
The word '' ...
and
IBM Db2
Db2 is a family of data management products, including database servers, developed by IBM. It initially supported the relational model, but was extended to support object–relational features and non-relational structures like JSON a ...
provide a construct explicitly named CLOB, and the majority of other database systems support some form of the concept, often labeled as ''text'', ''memo'' or ''long character'' fields.
CLOBs usually have very high size-limits, of the order of gigabytes. The tradeoff for the capacity is usually limited access methods. In particular, some database systems limit certain
SQL clauses
In language, a clause is a constituent that comprises a semantic predicand (expressed or not) and a semantic predicate. A typical clause consists of a subject and a syntactic predicate, the latter typically a verb phrase composed of a verb ...
and/or functions, such as ''LIKE'' or ''SUBSTRING'' from being used on CLOBs. Those that permit such operations may perform them very slowly.
Alternative methods of accessing the data are often provided, including means of extracting or inserting ranges of data from the CLOB.
Database systems vary in their storage patterns for CLOBs. Some systems always store CLOBs as a reference to out-of-table data, while others store small CLOBs in-table, changing their storage patterns when the size of the data grows beyond a threshold. Other systems are configurable in their behavior.
Implementations
PostgreSQL 15.0: unsupported but it can be easily defined as a synonym to the text type with:
create domain CLOB as TEXT;
MariaDB 10.8: supported
MySQL 8.0: support unknown. There used
to be a CLOB mentioned in the manual but the data type is no longer mentioned in later manuals.
See also
*
Binary large object
*
Binary blob
In the context of free and open-source software, proprietary software only available as a binary executable is referred to as a blob or binary blob. The term usually refers to a device driver module loaded into the kernel of an open-source ope ...
References
Data types
{{Database-stub