Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9GCuBP29244 for ; Tue, 16 Oct 2001 08:56:11 -0400 (EDT) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id f9GCu4P07329; Tue, 16 Oct 2001 08:56:04 -0400 (EDT) From: Bruce Momjian Message-Id: <200110161256.f9GCu4P07329@candle.pha.pa.us> Subject: Re: VARCHAR vs TEXT In-Reply-To: "from Vivek Khera at Oct 15, 2001 12:03:20 pm" To: Vivek Khera Date: Tue, 16 Oct 2001 08:56:04 -0400 (EDT) CC: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200110/204 X-Sequence-Number: 5159 > >>>>> "BM" == Bruce Momjian writes: > > BM>

CHAR() is best when storing strings that are usually the > BM> same length. VARCHAR() is best when storing variable-length strings, > BM> but you want to limit how long a string can be. TEXT is for strings > BM> of unlimited length, maximum 1 gigabyte. BYTEA is for storing > BM> binary data, particularly values that include NULL bytes.

> > Could you add the length limitation for TEXT to the reference manual? > I searched high and low for that limit, but never found it. Also, > what's the max VARCHAR() or CHAR() I can create? Is that also 1Gb? TEXT limit is 1GB, as shown on the 'limits' FAQ item. Is it worth mentioning here? CHAR()/VARCHAR() also 1GB limit. -- 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