Re: Difference between char and varchar

From: Franck Routier <franck(dot)routier(at)axege(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Difference between char and varchar
Date: 2006-08-29 10:22:07
Message-ID: 44F4154F.6090308@axege.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bruno Wolff III a écrit :
> 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.
>
But it is not 'standard' sql, so it won't be portable to other
databases, if needed.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jasbinder Bali 2006-08-29 17:29:28 Re: Shared Objects (Dynamic loading)
Previous Message Michael Fuhr 2006-08-29 10:04:57 Re: to_date syntax error