What is the difference between CHARACTER VARYING and VARCHAR in PostgreSQL? What is the difference between CHARACTER VARYING and VARCHAR in PostgreSQL? database database

What is the difference between CHARACTER VARYING and VARCHAR in PostgreSQL?


VARCHAR is an alias for CHARACTER VARYING, so no difference, see documentation :)

The notations varchar(n) and char(n)are aliases for character varying(n)and character(n), respectively.character without length specifier isequivalent to character(1). Ifcharacter varying is used withoutlength specifier, the type acceptsstrings of any size. The latter is aPostgreSQL extension.


The PostgreSQL documentation on Character Types is a good reference for this. They are two different names for the same type.


The only difference is that CHARACTER VARYING is more human friendly than VARCHAR