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 1rRrF6-009l1S-1F for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 10:09:24 +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 1rRrF4-0031f7-Gg for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 10:09:22 +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 1rRrF4-0031ez-7P for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 10:09:22 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRrF0-002lrA-Jm for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 10:09:20 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 2F9392FE360A for ; Mon, 22 Jan 2024 11:09:15 +0100 (CET) Received: from s981.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 1FC272E28634; Mon, 22 Jan 2024 11:09:15 +0100 (CET) Received: from s473.loopia.se (unknown [172.22.191.6]) by s981.loopia.se (Postfix) with ESMTP id 1D71B22B1782; Mon, 22 Jan 2024 11:09:15 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.01 X-Spam-Level: X-Spam-Status: No, score=-1.01 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=disabled Received: from s979.loopia.se ([172.22.191.5]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with LMTP id hM3cOisWC5vQ; Mon, 22 Jan 2024 11:09:14 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s979.loopia.se (Postfix) with ESMTPSA id 8440910BC46E; Mon, 22 Jan 2024 11:09:14 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: initdb's -c option behaves wrong way? From: Daniel Gustafsson In-Reply-To: <2629788.1705682037@sss.pgh.pa.us> Date: Mon, 22 Jan 2024 11:09:14 +0100 Cc: Kyotaro Horiguchi , Robert Haas , Alvaro Herrera , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <2062980.1705523170@sss.pgh.pa.us> <2063810.1705523582@sss.pgh.pa.us> <2FC1625E-4757-4076-8965-7DBDA5ECC6D9@yesql.se> <20240118.134944.899707778910524729.horikyota.ntt@gmail.com> <8103BBF3-107B-4FE8-B325-B9FC2BF7429D@yesql.se> <2629788.1705682037@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3696.120.41.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 19 Jan 2024, at 17:33, Tom Lane wrote: >=20 > Daniel Gustafsson writes: >> I'll give some more time for opinions, then I'll go ahead with one of = the >> patches with a backpatch to v16. >=20 > OK, I take back my previous complaint that just using strncasecmp > would be enough --- I was misremembering how the code worked, and > you're right that it would use the spelling from the command line > rather than that from the file. >=20 > However, the v3 patch is flat broken. You can't assume you have > found a match until you've verified that whitespace and '=3D' > appear next --- otherwise, you'll be fooled by a guc_name that > is a prefix of one that appears in the file. I think the simplest > change that does it correctly is as attached. The attached v4 looks good to me, I don't think it moves the needle wrt readability (ie, no need to move the search). Feel free to go ahead = with that version, or let me know if you want me to deal with it. -- Daniel Gustafsson