Re: Column data type in doc example may be changed to VARCHAR from TEXT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Column data type in doc example may be changed to VARCHAR from TEXT
Дата
Msg-id 3650117.1721280482@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Column data type in doc example may be changed to VARCHAR from TEXT  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wednesday, July 17, 2024, Muhammad Ikram <mmikram@gmail.com> wrote:
>> IMHO, a minor issue in the doc. As a good practice we use TEXT data type
>> when we expect longer text e.g. comments, doc kind of columns.

> Who is we in this conversation?  If it’s the documentation please reference
> existing work.  Text is our preferred type and we are fairly consistent in
> using it to my knowledge.

Even granting the premise, who's to say what an appropriate maximum
length for "products.name" would be?

IMNSHO, both char(N) and varchar(N) are hangovers from punched-card
days.  The number of cases where you can actually specify a limit
that wasn't pulled out of the air can be counted without running out
of fingers.  Moreover, most of those cases can be traced to standards
that were written when punched cards were au courant (postal codes for
example) and hence thought that an arbitrary limit was a good thing.
Time to move on.

            regards, tom lane



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