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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Muhammad Ikram <mmikram(at)gmail(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Column data type in doc example may be changed to VARCHAR from TEXT
Date: 2024-07-18 05:28:02
Message-ID: 3650117.1721280482@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wednesday, July 17, 2024, Muhammad Ikram <mmikram(at)gmail(dot)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

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2024-07-18 05:45:04 Re: A minor bug in doc. Hovering over heading shows # besides it.
Previous Message Muhammad Ikram 2024-07-18 05:22:04 Re: Column data type in doc example may be changed to VARCHAR from TEXT