Skip site navigation (1) Skip section navigation (2)

Re: TypeInfoCache

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Daniel Migowski" <dmigowski(at)ikoffice(dot)de>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: TypeInfoCache
Date: 2007-12-19 16:11:25
Message-ID: 873atymzpu.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
"Daniel Migowski" <dmigowski(at)ikoffice(dot)de> 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

In response to

Responses

pgsql-jdbc by date

Next:From: Daniel MigowskiDate: 2007-12-19 18:17:46
Subject: Re: TypeInfoCache
Previous:From: Daniel MigowskiDate: 2007-12-19 15:50:32
Subject: Re: TypeInfoCache

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group