Received: from candle.pha.pa.us (pgman@nav-43.dsl.navpoint.com [162.33.245.46]) by hub.org (8.10.1/8.10.1) with ESMTP id e9C32Wr85994 for ; Wed, 11 Oct 2000 23:02:32 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id XAA02812; Wed, 11 Oct 2000 23:02:14 -0400 (EDT) From: Bruce Momjian Message-Id: <200010120302.XAA02812@candle.pha.pa.us> Subject: Re: Char datatype In-Reply-To: <39914519.84650A1A@criticalsoftware.com> "from Andre Restivo at Aug 9, 2000 12:48:41 pm" To: Andre Restivo Date: Wed, 11 Oct 2000 23:02:13 -0400 (EDT) CC: pgsql-admin@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL77 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200010/54 X-Sequence-Number: 848 [ 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@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026