Text Type
Text Type
От:
"Paul Skinner" <skin@skin.dhs.org>
Дата:
Character Types
SQL defines two primary character types: character and character varying. Postgres supports these types, in addition to the more general text type, which unlike character varying does not require an explicit declared upper limit on the size of the field.
Table 3-4. Postgres Character Types
| Character Type | Storage | Recommendation | Description |
|---|---|---|---|
| character(n), char(n) | (4+n) bytes | SQL-compatible | Fixed-length blank padded |
| character varying(n), varchar(n) | (4+n) bytes | SQL-compatible | Variable-length with limit |
| text | (4+n) bytes | Most flexible | Variable unlimited length |
-----------------------
Text type is not unlimited but rather limited by tuple size of 8140 bytes.
Paul