Re: Use uppercase keywords in foreign key tutorial - Mailing list pgsql-docs

From Tom Lane
Subject Re: Use uppercase keywords in foreign key tutorial
Date
Msg-id 2903384.1761770924@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use uppercase keywords in foreign key tutorial  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Use uppercase keywords in foreign key tutorial
List pgsql-docs
Bruce Momjian <bruce@momjian.us> 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



pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Use uppercase keywords in foreign key tutorial
Next
From: David Rowley
Date:
Subject: Re: Use uppercase keywords in foreign key tutorial