VARCHAR
is an alias for CHARACTER VARYING
, so no difference, see documentation 🙂
The notations
varchar(n)
andchar(n)
are aliases forcharacter varying(n)
andcharacter(n)
, respectively.character
without length specifier is equivalent tocharacter(1)
. Ifcharacter varying
is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension.
Note on capitalization: The PostgreSQL documentation uses the all lower case stylization: character varying
. In contrast the official SQL standard uses the stylization with all caps throughout its 1000 pages: CHARACTER VARYING
.