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

Léo Léopold Hertz 준영 picture Léo Léopold Hertz 준영 · Jul 29, 2009 · Viewed 97.9k times · Source

John uses CHARACTER VARYING in the places where I use VARCHAR. I am a beginner, while he is an expert. This suggests me that there is something which I do not know.

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

Answer

Charles Ma picture Charles Ma · Jul 29, 2009

Varying is an alias for varchar, 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 is equivalent to character(1). If character varying is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension.