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 1vED6H-007NaR-II for pgsql-docs@arkaria.postgresql.org; Wed, 29 Oct 2025 20:48:56 +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 1vED6G-003keb-Gk for pgsql-docs@arkaria.postgresql.org; Wed, 29 Oct 2025 20:48:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vED6G-003keT-8z for pgsql-docs@lists.postgresql.org; Wed, 29 Oct 2025 20:48:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vED6D-004RpB-23 for pgsql-docs@lists.postgresql.org; Wed, 29 Oct 2025 20:48:54 +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 59TKmixL2903385; Wed, 29 Oct 2025 16:48:44 -0400 From: Tom Lane To: Bruce Momjian cc: Nathan Bossart , Euler Taveira , David Rowley , Erik Wienhold , pgsql-docs@lists.postgresql.org Subject: Re: Use uppercase keywords in foreign key tutorial In-reply-to: References: <82eb512b-8ed2-46be-b311-54ffd26978c4@ewie.name> <0a9d7393-1cf2-4d38-a648-631c1f93e345@ewie.name> Comments: In-reply-to Bruce Momjian message dated "Wed, 29 Oct 2025 16:34:24 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2903383.1761770924.1@sss.pgh.pa.us> Date: Wed, 29 Oct 2025 16:48:44 -0400 Message-ID: <2903384.1761770924@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > On Tue, Oct 28, 2025 at 04:34:45PM -0500, Nathan Bossart wrote: >> I noticed the patch also changes some column types to lowercase: >> ... >> - category_N TEXT >> + category_N text >> >> FWIW I tend to use uppercase for those, too, but I'm not sure there is a >> preferred style for the docs. > Agreed, uppercase is better for type names. "text" is not a keyword according to either us or the SQL standard. I agree that there's some reason to capitalize things that are grammar keywords, such as INTEGER or VARCHAR, but it's a big stretch to go from that to capitalizing everything that is a type name. Would you capitalize user-defined type names? A concrete reason for worrying about this distinction is that the keywords will be interpreted the same regardless of search_path, but ordinary-identifier names will not. But having said that, I think 100% consistency about this sort of stylistic choice is neither achievable (for any long period) nor particularly desirable. In the worst case it could mislead novices into thinking that case is significant when it isn't. regards, tom lane