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

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Emi Lu <emilu(at)cs(dot)concordia(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: About column type to "varchar(1)" or "char(1)"
Date: 2005-08-24 22:28:56
Message-ID: 20050824222831.GA25775@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 24, 2005 at 03:06:18PM -0400, Emi Lu wrote:
> Good afternoon,
>
> A question about varchar(1) and char(1).

<snip>

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

As far as storage goes, nope. Think about it, depending on your
encoding, 1 character might be 4 bytes.

char() adds padding but varchar() doesn't. That's the difference
really...

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message William Yu 2005-08-24 23:22:39 Re: Postgresql replication
Previous Message Jim C. Nasby 2005-08-24 22:19:17 Re: Postgresql replication