X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0E1DF9DC9C8 for ; Mon, 9 Jan 2006 19:50:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31103-07 for ; Mon, 9 Jan 2006 19:50:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 816DE9DC95F for ; Mon, 9 Jan 2006 19:50:32 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k09NoV022662; Mon, 9 Jan 2006 18:50:31 -0500 (EST) From: Bruce Momjian Message-Id: <200601092350.k09NoV022662@candle.pha.pa.us> Subject: Re: [PERFORMANCE] Beetwen text and varchar field In-Reply-To: <20060109114940.GB28748@uio.no> To: "Steinar H. Gunderson" Date: Mon, 9 Jan 2006 18:50:31 -0500 (EST) CC: TNO , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200601/71 X-Sequence-Number: 16549 See the FAQ. --------------------------------------------------------------------------- Steinar H. Gunderson wrote: > On Mon, Jan 09, 2006 at 11:58:19AM +0100, TNO wrote: > > what is the best for a char field with less than 1000 characters? > > a text field or a varchar(1000) > > They will be equivalent. text and varchar are the same type internally -- the > only differences are that varchar can have a length (but does not need one), > and that some casts are only defined for text. > > If there's really a natural thousand-character limit to the data in question, > use varchar(1000); if not, use text or varchar, whatever you'd like. > > /* Steinar */ > -- > Homepage: http://www.sesse.net/ > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073