Re: TypeInfoCache

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: TypeInfoCache
Дата
Msg-id 873atymzpu.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: TypeInfoCache  (Daniel Migowski <dmigowski@ikoffice.de>)
Ответы Re: TypeInfoCache
Re: TypeInfoCache
Список pgsql-jdbc
"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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: setting PreparedStatement parameter using "at time zone interval ?"
Следующее
От: Daniel Migowski
Дата:
Сообщение: Re: TypeInfoCache