From: Gregory Stark <stark@enterprisedb.com>
To: Daniel Migowski <dmigowski@ikoffice.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: TypeInfoCache
Date: Wed, 19 Dec 2007 16:11:25 +0000
Message-ID: <873atymzpu.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <47693B10.3040804@ikoffice.de>
References: <47692DEB.9070307@ikoffice.de>
<877ijan2cp.fsf@oxford.xeocode.com>
<47693B10.3040804@ikoffice.de>
"Daniel Migowski" <dmigowski@ikoffice.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: stark@enterprisedb.com, dmigowski@ikoffice.de
Subject: Re: TypeInfoCache
In-Reply-To: <873atymzpu.fsf@oxford.xeocode.com>
References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> <47693B10.3040804@ikoffice.de> <873atymzpu.fsf@oxford.xeocode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox