Re: Simple 'type' question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Simple 'type' question
Дата
Msg-id 21086.1011916263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Simple 'type' question  ("Tim Barnard" <tbarnard@povn.com>)
Список pgsql-general
"Tim Barnard" <tbarnard@povn.com> writes:
> When creating a table with a primary key that can contain any varying
> sequence of alphanumeric characters, is it best to use the 'text' type or
> the 'varchar' type?

If you want a specific upper limit on the string length, use varchar.
If that's not needed, use text.  The only difference in performance
AFAIK is the extra function call per insert/update for the routine that
enforces the varchar limit.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Is there a drawback when changing NAMEDATALEN to 64?
Следующее
От: Elein
Дата:
Сообщение: Yet another optimizer index choosing questions