Re: name vs varchar vs text?

Поиск
Список
Период
Сортировка
От Ian Lance Taylor
Тема Re: name vs varchar vs text?
Дата
Msg-id siae6yn5p5.fsf@daffy.airs.com
обсуждение исходный текст
Ответ на name vs varchar vs text?  ("mike" <mike@quadrent.net>)
Список pgsql-general
"mike" <mike@quadrent.net> writes:

> reading through the curent development docs, I've run accross a data type called "name", and it looks very similar to
varcharor text, and I'm wondering if there is any atvantage to useing this data type over varchar or even text? 

The NAME type is used to hold table and column names.  It is a fixed
length char field of length NAMEDATALEN in postgres_ext.h (default
32).

If you happen to want a field which has a fixed size of 32 characters,
you can use NAME.  Or you can use CHAR(32).  NAME is actually slightly
different from CHAR(32), in that no length is stored with a NAME
field.  That probably makes NAME a bit more efficient.  I don't know
why a length is stored with a fixed length CHAR field, but it is.

Ian

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

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: python-postgres RPM
Следующее
От: Soma Interesting
Дата:
Сообщение: time to integer