Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3BD122E379C for ; Wed, 19 Dec 2007 12:11:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 30698-05 for ; Wed, 19 Dec 2007 12:11:27 -0400 (AST) Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id ED0242E376A for ; Wed, 19 Dec 2007 12:11:26 -0400 (AST) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1J51W1-0001kh-6i; Wed, 19 Dec 2007 16:11:25 +0000 To: "Daniel Migowski" Cc: Subject: Re: TypeInfoCache In-Reply-To: <47693B10.3040804@ikoffice.de> (Daniel Migowski's message of "Wed\, 19 Dec 2007 16\:38\:56 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX" 55068) References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> <47693B10.3040804@ikoffice.de> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 19 Dec 2007 16:11:25 +0000 Message-ID: <873atymzpu.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/151 X-Sequence-Number: 18006 "Daniel Migowski" writes: >> Why? > > Because VARCHAR (in my understanding) has some limit, like 256 or 50 or even > 8192, whatever. yes, 2GB, same as text. > LONGVARCHAR is unlimited as I understand and much better > matches what i understood what "text" is for. Well you haven't explained what you understand "text" is for but in Postgres they can be used pretty much interchangeably. I think this has come up before, you should check the mail archives. The problem is that describing "text" as if it's not a simple varchar type of type confuses other applications into restricting what you can do with it. They assume it has the kind of restrictions other databases impose. Generally in Postgres you're probably best off using "text" unless you have some specific limit you need to impose. In most cases Postgres will silently cast your varchars to text when necessary but every now and then you might find a case where it doesn't and fails to use an index or optimize a query where it could. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production Tuning