Re: please advise on column data type

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: please advise on column data type
Дата
Msg-id web-1371907@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на please advise on column data type  ("jack" <datactrl@tpg.com.au>)
Ответы Re: please advise on column data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Jack,

Please post your questions to PGSQL-NOVICE in the future.  That is the
more appropriate venue for your type of question.  PGSQL-SQL is more
appropriate for advanced SQL questions and arguments about the SQL-92
standard.

> When I create a table can I always use the rule, use VARCHAR for all
> variable length string data and use CHAR for only fixed length string
> data.
> Or I have to consider if the column will be set as an index or
> primary key,
> it would be better to use CHAR for better performance.

In some databases, yes.  However, in PostgreSQL, there is no
performance difference between CHAR, VARCHAR, and TEXT.  So use what's
appropriate for the data being stored.

-Josh Berkus




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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: How slow is DISTINCT?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: please advise on column data type