I see different schemas using TEXT, CHAR, VARCHAR, CHARACTER VARYING, CHAR VARYING to store string data. Which should I use in CockroachDB?
All the types mentioned are equivalent; see the CockroachDB STRING documentation for an exhaustive list.
In CockroachDB, the following are aliases for
STRING:
CHARACTERCHARVARCHARTEXTAnd the following are aliases for
STRING(n):
CHARACTER(n)CHARACTER VARYING(n)CHAR(n)CHAR VARYING(n)VARCHAR(n)
CockroachDB will treat all of these types identically. The canonical name for the type in CockroachDB, however, is STRING, so if you're starting a new application from scratch, you'll reduce confusion by preferring STRING over the other aliases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With