- Non-standard alternatives available
The fixed-length character string type of SQL is character, the shorter char is a synonym.
CREATE TABLE … (
currency CHAR(3)
)The character type can be parameterized to set its length—like 3 in the example. Note that the unit are characters, not bytes.✓✗ In absence of the length, the length defaults to 1 character.
- Length limitation not enforced
Values shorter than the length are space-padded at the end to reach the required length. Note that pad space collations cause fixed-length string comparisons to behave similar to variable-length string comparisons.
As the type character stores characters, rather than bytes, the character set and collate clauses may be specified.
Non-Standard Alternatives
- Note that
bpchar(without length) is a variable-length string - Length limitation not enforced
Related
- Supplementary Features
- Mandatory Features
- Optional Features
- Implementation-defined Elements
Normative References
The SQL types character and char are defined in ISO/IEC 9075-2:2023 as mandatory feature E021-01, “CHARACTER data type (including all its spellings)”. They were already available in SQL-92 (entry level).

