What's the difference between TEXT, CHAR and VARCHAR in CockroachDB?
1 answer
All types mentioned are equivalent; see the CockroachDB STRING documentation for an exhaustive list.
CockroachDB has the following aliases for
STRING
:
CHARACTER
CHAR
VARCHAR
TEXT
And the following aliases are for
STRING(n)
:
CHARACTER(n)
CHARACTER VARYING(n)
CHAR(n)
CHAR VARYING(n)
VARCHAR(n)
CockroachDB will handle all of these types in the same way. The canonical name for a type in CockroachDB is, however, STRING
so if you start a new application from scratch, you will reduce confusion by preferring STRING
over other aliases.
+2
source to share