Skip site navigation (1) Skip section navigation (2)

Re: Difference between char and varchar

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Richmond(dot)Dyes(at)monroehosp(dot)org
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Difference between char and varchar
Date: 2006-08-29 00:10:19
Message-ID: 20060829001019.GA10848@wolff.to (view raw or flat)
Thread:
Lists: pgsql-novice
On Mon, Aug 28, 2006 at 15:04:26 -0400,
  Richmond Dyes <rdyes(at)monroehosp(dot)org> wrote:
> I know the difference between char and varchar is char is fixed length 
> and varchar returns variable length.  Which one should be used and why?

You normally want to use 'text' instead of either 'char' or 'varchar'.
Unless there is a business rule limiting the length of a string (and sometimes
not even then) you want to use 'text' as it is more flexible.

In response to

Responses

pgsql-novice by date

Next:From: Michael FuhrDate: 2006-08-29 02:19:15
Subject: Re: [GENERAL] Shared Objects (Dynamic loading)
Previous:From: Jasbinder BaliDate: 2006-08-28 19:26:55
Subject: Re: [GENERAL] Shared Objects (Dynamic loading)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group