From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Muhammad Ikram <mmikram@gmail.com>
Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>
Subject: Re: Column data type in doc example may be changed to VARCHAR from TEXT
Date: Thu, 18 Jul 2024 01:28:02 -0400
Message-ID: <3650117.1721280482@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYOvYxA-UQxefZbXJGBr8pKeHUqosJExzjbFfXv2F6VHw@mail.gmail.com>
References: <CAGeimVq=a4B5KhnBjmm5CrwkDuMtBC1=dvL93LUeucyPBS2ufw@mail.gmail.com>
<CAKFQuwYOvYxA-UQxefZbXJGBr8pKeHUqosJExzjbFfXv2F6VHw@mail.gmail.com>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, mmikram@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: Column data type in doc example may be changed to VARCHAR from TEXT
In-Reply-To: <3650117.1721280482@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox