Re: CHAR or VARCHAR - Mailing list pgsql-sql

From Tom Lane
Subject Re: CHAR or VARCHAR
Date
Msg-id 19429.985554891@sss.pgh.pa.us
Whole thread Raw
In response to Re: CHAR or VARCHAR  ("Peter J. Schoenster" <peter@schoenster.com>)
Responses Re: CHAR or VARCHAR
List pgsql-sql
"Peter J. Schoenster" <peter@schoenster.com> writes:
> On 22 Mar 2001, at 10:05, Tom Lane wrote:
>> There is *no* performance advantage of CHAR(n) over VARCHAR(n).

> I wonder if this question of char/varchar is postgresql specific or 
> rdbms in general.

It's definitely RDBMS-specific.  My comment applied to Postgres, which
stores CHAR(n) and VARCHAR(n) in essentially the same fashion --- it
doesn't really exploit the fact that CHAR(n) is fixed-size.  (Mainly
because it's *not* fixed size in PG, what with TOAST, multibyte, etc.)

On other DBMSes there could be a difference, especially if the DBMS has
performance problems with variable-length fields.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Joe Conway"
Date:
Subject: Re: Help
Next
From: Grant
Date:
Subject: Re: Serials.