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 1vG0pO-005nsX-Fq for pgsql-docs@arkaria.postgresql.org; Mon, 03 Nov 2025 20:06:59 +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 1vG0pN-008xDf-91 for pgsql-docs@arkaria.postgresql.org; Mon, 03 Nov 2025 20:06:56 +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 1vG0pM-008xAl-Nr for pgsql-docs@lists.postgresql.org; Mon, 03 Nov 2025 20:06:56 +0000 Received: from mout-u-107.mailbox.org ([80.241.59.207]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vG0pI-005nxd-1L for pgsql-docs@lists.postgresql.org; Mon, 03 Nov 2025 20:06:55 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4d0jKN6gwmz9snb; Mon, 3 Nov 2025 21:06:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1762200409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=taiab3dRcPCUgIwOgRob0yr9itCOFn27n5FCQRnHAHQ=; b=Xrzulxl++wcJ0sLDqgJ6HBUfrRCekWB2p4njZ7tAwovLFYwpMFD33KOp4FmDJalOSQnzP0 e9+yOAKwGfOhv/cCcYbuOf1p1QPRF9DvAk1m5T+6N8OxnQILHKTF5sfaYXGil7+AJlNiA+ jhCyyfXfcxyuy65HbqHtV1ZLrLk06g5g163gdl5DbQ/FFw/HRkNZDuBJS997IgaSCbeUoN uf7OB07CjlsVKfOepqu07u0sOhqxLPZEPirlGFvdotPcqA3lE/jRW7r1MtkgnkpYYHsMZp gpzIUWq1whCxF/fNG/PUQnR2DUVG/qt2qZQTutaFE0bW5qB/dEhKQEuAbcSHpA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ewie@ewie.name designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=ewie@ewie.name Date: Mon, 3 Nov 2025 21:06:44 +0100 From: Erik Wienhold To: David Rowley Cc: Tom Lane , Bruce Momjian , Nathan Bossart , Euler Taveira , pgsql-docs@lists.postgresql.org Subject: Re: Use uppercase keywords in foreign key tutorial Message-ID: <32882add-b671-42db-a041-e2c2c5b7c315@ewie.name> References: <0a9d7393-1cf2-4d38-a648-631c1f93e345@ewie.name> <2903384.1761770924@sss.pgh.pa.us> <0a68a965-4599-4af1-a1eb-bd8e1be75788@ewie.name> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="msbjuniwlqa4qqft" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4d0jKN6gwmz9snb List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --msbjuniwlqa4qqft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2025-10-31 04:03 +0100, David Rowley wrote: > On Fri, 31 Oct 2025 at 13:53, Erik Wienhold wrote: > > But I also agree with Tom that keeping a consistent style is impossible > > in the long run. But it also shows that the docs are still written by > > humans. As long as we can keep a consistent style within a single > > listing (or even an entire page) I'm satisfied as a reader. > > For me, I don't see this as a reason not to try. If we do get things > to a consistent point, then anyone making changes that reference > existing portions of the documentation for inspiration should maintain > consistency. If we're entirely random, then there's no hope for anyone > to figure out what the best practice or perfected casing is. Sure. I didn't say we shouldn't try. But from my experience, minor formatting issues slip through all the time if you can't rely on an autoformatter or linter. Maybe less so in these docs because the sample queries are usually short. But it already took me a couple of rounds to find every lowercase keyword so far and I guess I still missed some. > > Besides that I've fixed a couple of more places that had lowercase > > keywords or were missing some whitespace that I had missed before. > > A couple of things. > > 1) I see you've added a space after "INSERT INTO table" and before the > column list, but not consistently, per: > > git grep -E "INSERT INTO \w+\(" Fixed in the attached v4. Except for one match in dblink.sgml that is the sample output of dblink_build_sql_insert which actually omits the space after the table name and VALUES keyword. > 2) An identifier casing has been changed here: > > -SELECT sub_part, SUM(quantity) as total_quantity > +SELECT sub_part, sum(quantity) AS total_quantity Reverted back to uppercase SUM. I think this was the only changed identifier and what remains should only be keyword and whitespace changes to keep the patch focused on that. > You could also look at the results of the SQL command that's returned > by the following SQL to see if there's anything else. I do see some > "ROLLUP(", "EXISTS(", "GROUPING(" and "VALUES(" in there. You have > been changing "VALUES(" to "VALUES (", so I assume those ones have > been missed: > > select 'git grep -E "\b(' || string_agg(UPPER(word),'|') || ')\("' > from pg_get_keywords(); Thanks. Fixed those as well. But only for keywords with non-C catcodes because I figured that the catcode C keywords mostly cover builtin function names where extra whitespace before the opening paren doesn't make sense. Missed the uppercase keywords before because I was only searching for the lowercase ones. -- Erik Wienhold --msbjuniwlqa4qqft Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v4-0001-doc-Apply-consistent-formatting-to-sample-SQL-sta.patch"