Re: Char datatype

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andre Restivo <arestivo(at)criticalsoftware(dot)com>
Cc: pgsql-admin(at)postgreSQL(dot)org
Subject: Re: Char datatype
Date: 2000-10-12 03:02:13
Message-ID: 200010120302.XAA02812@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

[ Charset ISO-8859-15 unsupported, converting... ]
> Hi,
>
> Does anyone know why does pg use 4+n bytes to store a char(n) field? The
> four initial bytes seem to have only null chars so why are they used?

The 4 bytes is for the length of the string to be stored.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Loïc TREGOUËT 2000-10-12 12:35:03 ERROR: ORDER BY is not allowed in INSERT/SELECT
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2000-10-10 18:46:43 Re: Re: [ADMIN] PostgreSQL encoding question