Re: Disadvantages to using "text"

Поиск
Список
Период
Сортировка
От Aurynn Shaw
Тема Re: Disadvantages to using "text"
Дата
Msg-id 4821D282.1020001@commandprompt.com
обсуждение исходный текст
Ответ на Disadvantages to using "text"  ("Don Mies (NIM)" <dmies@networksinmotion.com>)
Ответы Re: Disadvantages to using "text"
Re: Disadvantages to using "text"
Список pgsql-novice
> Are there any reasons for not using the “text” type whenever a variable
> length string field is needed?  Are there penalties in disk usage,
> memory usage or performance?
>
>
>
> What are the differences between declaring something “varchar” or
> “varchar(n)” or “text”?  (I realize that the middle one has an upper
> limit while the others do not.)

Actually, no, there's no reason to use varchar over text, unless you are
wanting to explicitly limit the input length of your data.

Internally, Postgres treats a VARCHAR(n) as a TEXT with a CHECK
constraint applied to it, so VARCHAR is going to be slightly slower to use.

Hope that helps,
Aurynn.

--
Aurynn Shaw

The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 103
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

ashaw@commandprompt.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Disadvantages to using "text"
Следующее
От: Bruce Hyatt
Дата:
Сообщение: Re: Disadvantages to using "text"