public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Bruce Momjian <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Euler Taveira <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: [email protected]
Subject: Re: Use uppercase keywords in foreign key tutorial
Date: Wed, 29 Oct 2025 16:48:44 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAApHDvoLfa2UjGfoGfVL4b=g5VbFgscrLONuC3kKE9=VZeeN=Q@mail.gmail.com>
<[email protected]>
<aQE29YG5pY4Cl8ym@nathan>
<[email protected]>
Bruce Momjian <[email protected]> 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
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Use uppercase keywords in foreign key tutorial
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox