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 1vG4Xh-007NAc-Na for pgsql-docs@arkaria.postgresql.org; Tue, 04 Nov 2025 00:04:58 +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 1vG4Xf-00AEmf-UL for pgsql-docs@arkaria.postgresql.org; Tue, 04 Nov 2025 00:04:54 +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 1vG4Xe-00AEmU-Rt for pgsql-docs@lists.postgresql.org; Tue, 04 Nov 2025 00:04:54 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vG4XY-005JPO-1q for pgsql-docs@lists.postgresql.org; Tue, 04 Nov 2025 00:04:52 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (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-204.mailbox.org (Postfix) with ESMTPS id 4d0pbs377xz9tPW; Tue, 4 Nov 2025 01:04:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1762214681; 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=+YlV6VPDr38Oj6U6P1/f4DfTO/niw3TtVqA+VOd/UbQ=; b=rPHh0VBLjupR3TsiP9bj3KsY7YgFlpCcHVrhgpzCuEkd40K4GmPaU71QAThRVmRvtOePV9 hA+I6GWV64PXKyQ9aAFJbrjGtzCpdmlE7FLmSOHr5wxEARJIePlkw45/p95BTD/XLJI4uY b8Ca08poKzj+DgKGEvNN/W18AV5ovyHiRc265bPwcj67jHv/IroLlqbV/RFkMAX/6kJXc8 bl4nnmLeu53cHqvFeH62aocVF2gbiI1xWaoOfDJUXMsI/WpJ5vaJ3NTyKSUlIDZDdTTyMj 7yli4nmFW8iObPzlf5CT9TO0Mz5lhSbLru/JcVMDoNirbTpXIHkEs/pHVqGK8g== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ewie@ewie.name designates 2001:67c:2050:b231:465::2 as permitted sender) smtp.mailfrom=ewie@ewie.name Date: Tue, 4 Nov 2025 01:04:38 +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: <4487a138-c4d2-4b06-80b3-5afe7f8e5d82@ewie.name> References: <2903384.1761770924@sss.pgh.pa.us> <0a68a965-4599-4af1-a1eb-bd8e1be75788@ewie.name> <32882add-b671-42db-a041-e2c2c5b7c315@ewie.name> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="opexzftefkxmdzod" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4d0pbs377xz9tPW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --opexzftefkxmdzod Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2025-11-03 23:37 +0100, David Rowley wrote: > On Tue, 4 Nov 2025 at 09:06, Erik Wienhold wrote: > > 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. > > I went through all these and I think it's mostly good. Thanks. > However... > > It seems strange to me that you've made so many changes to transform > "CREATE TABLE foo(" into "CREATE TABLE foo (", but you've done the > opposite for CREATE FUNCTION and CREATE PROCEDURE. Did you go with the > majority rules here? Yes, CREATE FUNCTION with an extra space after the name is the exception. On master I count 29 (w/ space) vs. 249 (w/o space) matches: $ git grep -Ei 'create(\s+or\s+replace)?\s+(function|procedure)\s+\w+(\.\w+)?\s+\(' doc | wc -l 29 $ git grep -Ei 'create(\s+or\s+replace)?\s+(function|procedure)\s+\w+(\.\w+)?\(' doc | wc -l 249 I also see similar counts for CREATE TABLE, but with the one-space-after-table-name variant being more common: $ git grep -Ei 'create\s+table(\s+if\s+not\+sexists)?\s+\w+(\.\w+)?\s+\(' doc | wc -l 213 $ git grep -Ei 'create\s+table(\s+if\s+not\+sexists)?\s+\w+(\.\w+)?\(' doc | wc -l 34 The attached v5 fixes a couple of more places that I missed in v4. > It just seems a bit hard to follow what the standard is being enforced > here and if that's hard to understand now, what hope is there of > people following that in the future? I follow this rule/standard/convention which also matches what I already find in most parts of the docs: * No extra space for function calls, e.g. extract(YEAR FROM now()) * Extra space for everything else, e.g. VALUES (1, 2); CREATE TABLE foo (); > I'm starting to wonder if adjusting the spacing here is a worthwhile > change. I think it's worth to have that consistency. If the patch is too broad I can of course limit it to the listings with inconsistent keyword casing which is more less patch v2 plus some changes from v3 and later. Or just fix the keywords for now to get that out of the way and deal with the spacing in a separate patch/thread. -- Erik Wienhold --opexzftefkxmdzod Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v5-0001-doc-Apply-consistent-formatting-to-sample-SQL-sta.patch"