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 5AB329DCA2C for ; Mon, 9 Jan 2006 07:49:38 -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 48066-03 for ; Mon, 9 Jan 2006 07:49:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id B5DB19DCA30 for ; Mon, 9 Jan 2006 07:49:34 -0400 (AST) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1EvvWq-0007h8-BZ; Mon, 09 Jan 2006 12:49:36 +0100 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1EvvWu-0007WE-00; Mon, 09 Jan 2006 12:49:40 +0100 Date: Mon, 9 Jan 2006 12:49:40 +0100 From: "Steinar H. Gunderson" To: TNO Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORMANCE] Beetwen text and varchar field Message-ID: <20060109114940.GB28748@uio.no> Mail-Followup-To: TNO , pgsql-performance@postgresql.org References: <43C241CB.3060908@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <43C241CB.3060908@free.fr> X-Operating-System: Linux 2.6.14.3 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.06 required=5 tests=[AWL=0.060] X-Spam-Score: 0.06 X-Spam-Level: X-Archive-Number: 200601/54 X-Sequence-Number: 16532 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/