Re: char o varchar

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: char o varchar
Date: 2003-09-16 20:35:34
Message-ID: Pine.LNX.4.33.0309161434100.5612-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 16 Sep 2003, Edwin Quijada wrote:

>
>
>
>
> Hoii!!
>
> I am creating my struct and I have the question :
> What I must use for character fields char or varchar?
> Which are the differences? and the better

Generally speaking, varchar or text() types are preferred. char() types
are padded. I.e. if you create a table with char(8) and insert 'abc' then
select it, you'll get 'abc ' back, i.e. abc followed by padding spaces
to make it 8 wide.

Most of the time this is not what the user wants.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-09-16 20:44:17 Re: Idea for improving speed of pg_restore
Previous Message Network Administrator 2003-09-16 20:32:39 Re: State of Beta 2