Re: [GENERAL] CHAR data type - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: [GENERAL] CHAR data type
Date
Msg-id 20070321144829.GA58085@winnie.fuhr.org
Whole thread Raw
List pgsql-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?

http://www.postgresql.org/docs/8.2/interactive/datatype-character.html

"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:

http://www.postgresql.org/docs/8.2/interactive/storage-toast.html

--
Michael Fuhr

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Formating Date Data Type?
Next
From: Pranjal Karwal
Date:
Subject: can't trace error!!!