Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In PostgreSQL you can create a column with data type character varying (without length precision) or text like this:

ALTER TABLE test ADD COLUMN c1 varchar;

Is there a difference between these two data types?

The documentation is not clear about it. They say :

If character varying is used without length specifier, the type accepts strings of any size.


In addition, PostgreSQL provides the text type, which stores strings of any length.

It seems that these two datatypes are equivalent but it is not explicit... More info about this?

Thank you, Nico

share|improve this question
See the answer at – Daniel Vérité Jul 2 '12 at 12:47
up vote 3 down vote accepted

There is no difference between the two data types. They use the exact same storage and the same operators.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.