Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1RGJwx72246 for ; Tue, 27 Feb 2001 11:19:58 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id LAA15109; Tue, 27 Feb 2001 11:18:14 -0500 (EST) From: Bruce Momjian Message-Id: <200102271618.LAA15109@candle.pha.pa.us> Subject: Re: CHAR vs VARCHAR In-Reply-To: "from Derek Neighbors at Feb 26, 2001 12:46:03 pm" To: Derek Neighbors Date: Tue, 27 Feb 2001 11:18:14 -0500 (EST) 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: 200102/220 X-Sequence-Number: 827 > I browsed the FAQ and mailing list briefly to try to garner information > about the ups and downs of different character based datatypes. I did not > see any good document on preference or when to use one over the other. > > http://postgresql.readysetnet.com/docs/faq-english.html#4.15 noted that > some compression happens. > > http://postgresql.readysetnet.com/users-lounge/docs/7.0/user/datatype1066.htm > gives a good description and notes that text is best choice, but it not > being SQL compliant is an issue for most. > > The question is how much of speed difference is there between CHAR and > VARCHAR when doing searches etc? or are there any good rules others use > to determine when CHAR is better to use than VARCHAR or vice versa? FAQ item is accurate that compression happens on all variable length types. -- 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