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

John uses CHARACTER VARYING where I use VARCHAR . I am a beginner, and he is an expert. This suggests that there is something that I do not know.

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

+63
database postgresql varchar
Jul 29 '09 at 11:05
source share
4 answers

Variation is an alias for varchar, so there is no difference, see the documentation :)

The notation varchar (n) and char (n) are aliases for the variable character (n) and character (n), respectively. a character without a length specifier is equivalent to a character (1). If the character used without a length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension.

+75
Jul 29 '09 at 11:10
source share

The PostgreSQL documentation on character types is a good reference for this. These are two different names for the same type.

+11
Jul 29 '09 at 11:12
source share

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

+2
Sep 30 '14 at 10:34
source share

Both are the same thing, but many of the databases do not provide the char variable, mainly provided by postgreSQL. Thus, for a multiple database such as Oracle Postgre and DB2, it is useful to use Varchar

-one
Jan 08 '16 at 10:20
source share



All Articles