Re: varchar vs text columns

Поиск
Список
Период
Сортировка
От Lew
Тема Re: varchar vs text columns
Дата
Msg-id ZbCdnTkmkddcZjjbnZ2dnUVZ_gudnZ2d@comcast.com
обсуждение исходный текст
Ответ на Re: varchar vs text columns  (Andrew Sullivan <ajs@crankycanuck.ca>)
Список pgsql-admin
Andrew Sullivan wrote:
> On Mon, Jul 23, 2007 at 11:33:54AM -0700, Jessica Richard wrote:
>> What is the difference between varchar and text for a string column?
>> What is the benefit of using each one?
>> Is text better than varchar performance wise?
>
> From the manual:
>
>     Tip:  There are no performance differences between these
>     three types, apart from the increased storage size when using
>     the blank-padded type. While character(n) has performance
>     advantages in some other database systems, it has no such
>     advantages in PostgreSQL. In most situations text or
>     character varying should be used instead.
>
> Note that varchar(n) will have a performance effect, because on
> insert or update you have to check to make sure the input doesn't
> exceed the specified length.

See also Peter Koczan's reply in the '"_" in a serach  pattern' thread.

--
Lew

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

Предыдущее
От: tech@g-sistemas.com
Дата:
Сообщение: Set up a database without backup
Следующее
От: PostgreSQL Admin
Дата:
Сообщение: Re: deinstallation - reinstallation on Mac OS 10.4