Skip site navigation (1) Skip section navigation (2)

Re: CHAR data type

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Leticia <lgomez(at)itba(dot)edu(dot)ar>
Cc: pgsql-novice(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: CHAR data type
Date: 2007-03-21 14:48:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-novice
On Wed, Mar 21, 2007 at 11:29:54AM -0300, Leticia wrote:
> If I use "char(8000)" instead of "varchar(8000)" why there is no padding and
> these three tuples are inside the same page?

"The storage requirement for data of these types is 4 bytes plus
the actual string, and in case of character plus the padding. Long
strings are compressed by the system automatically, so the physical
requirement on disk may be less. Long values are also stored in
background tables so they do not interfere with rapid access to the
shorter column values."

See also the TOAST documentation:

Michael Fuhr

In response to

pgsql-novice by date

Next:From: Pranjal KarwalDate: 2007-03-21 16:02:37
Subject: can't trace error!!!
Previous:From: Michael FuhrDate: 2007-03-21 14:40:37
Subject: Re: Formating Date Data Type?

pgsql-general by date

Next:From: Tom LaneDate: 2007-03-21 14:49:41
Subject: Anyone still using the sql_inheritance parameter?
Previous:From: Joshua D. DrakeDate: 2007-03-21 14:46:00
Subject: Re: Lifecycle of PostgreSQL releases

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group