Re: Chante domain type - Postgres 9.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Chante domain type - Postgres 9.2
Дата
Msg-id 27315.1474894785@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Chante domain type - Postgres 9.2  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Ответы Re: Chante domain type - Postgres 9.2  (Rakesh Kumar <rakeshkumar464@outlook.com>)
RES: Chante domain type - Postgres 9.2  (Márcio A. Sepp <marcio@zyontecnologia.com.br>)
Список pgsql-general
Rakesh Kumar <rakeshkumar464@outlook.com> writes:
> Can you elaborate?  Why would anyone create a text column to store customer name or product name which can very well
bein varchar(50) type of cols. 

You sound like you think that varchar(50) is somehow cheaper than text.
That's backwards (at least in PG, other DBMSes may be different).
There's no advantage storage-wise, and there is a cost, namely the cost
of applying the length check on every update.

If you feel that you must have a check for application-specific reasons,
then sure, use varchar(n).  But the number had better be one that you
can trace to crystal-clear application requirements.  varchar(n) where
n has been plucked from the air is a good sign of bad database design.

            regards, tom lane


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

Предыдущее
От: Rakesh Kumar
Дата:
Сообщение: Re: Chante domain type - Postgres 9.2
Следующее
От: Rakesh Kumar
Дата:
Сообщение: Re: Chante domain type - Postgres 9.2