From: Tom Lane <tgl@sss.pgh.pa.us>
To: peter@schoenster.com
Cc: pgsql-sql@postgresql.org
Subject: Re: CHAR or VARCHAR
Date: Sun, 25 Mar 2001 16:14:51 -0500
Message-ID: <19429.985554891@sss.pgh.pa.us> (raw)
In-Reply-To: <3ABA1025.26143.F5F9331@localhost>
References: <01032208051900.07158@math.unl.edu.ar>
<3ABA1025.26143.F5F9331@localhost>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter@schoenster.com
Subject: Re: CHAR or VARCHAR
In-Reply-To: <19429.985554891@sss.pgh.pa.us>
References: <01032208051900.07158@math.unl.edu.ar> <3ABA1025.26143.F5F9331@localhost> <19429.985554891@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox