About column type to "varchar(1)" or "char(1)"

From: Emi Lu <emilu(at)cs(dot)concordia(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: About column type to "varchar(1)" or "char(1)"
Date: 2005-08-24 19:06:18
Message-ID: 430CC52A.6080001@cs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good afternoon,

A question about varchar(1) and char(1).
If we have two tables
test1 (col1 varchar(1), ... ... );
test2 (col1 char(1), ... ... );

In the manuall, it written:

*Tip: * There are no performance differences between these three types,
apart from the increased storage size when using the blank-padded type.
While character(/n/) has performance advantages in some other database
systems, it has no such advantages in PostgreSQL. In most situations
text or character varying should be used instead.

As a result, setup 'col1' to either "varchar(1)" or "char(1)" does not
matter at all?

Thanks a lot,
Emi

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2005-08-24 19:17:40 Re: Start up script for Fedora Core 3
Previous Message Dann Corbit 2005-08-24 18:59:59 Re: My Slow query.