Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUJgW-0026zj-S3 for pgsql-docs@arkaria.postgresql.org; Thu, 18 Jul 2024 05:28:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sUJgU-00AGHV-Ne for pgsql-docs@arkaria.postgresql.org; Thu, 18 Jul 2024 05:28:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUJgU-00AGHN-G8 for pgsql-docs@lists.postgresql.org; Thu, 18 Jul 2024 05:28:06 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUJgS-0009CG-OQ for pgsql-docs@lists.postgresql.org; Thu, 18 Jul 2024 05:28:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46I5S2lC3650118; Thu, 18 Jul 2024 01:28:02 -0400 From: Tom Lane To: "David G. Johnston" cc: Muhammad Ikram , "pgsql-docs@lists.postgresql.org" Subject: Re: Column data type in doc example may be changed to VARCHAR from TEXT In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 17 Jul 2024 22:17:56 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3650116.1721280482.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 18 Jul 2024 01:28:02 -0400 Message-ID: <3650117.1721280482@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Wednesday, July 17, 2024, Muhammad Ikram wrote: >> IMHO, a minor issue in the doc. As a good practice we use TEXT data typ= e >> when we expect longer text e.g. comments, doc kind of columns. > Who is we in this conversation? If it=E2=80=99s the documentation pleas= e 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