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 1ryYpe-00Gt1n-W3 for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Apr 2024 15:10:18 +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 1ryYpd-00EvUs-GC for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Apr 2024 15:10:17 +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 1ryYpd-00EvUk-75 for pgsql-hackers@lists.postgresql.org; Sun, 21 Apr 2024 15:10:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryYpa-002Azi-Vg for pgsql-hackers@lists.postgresql.org; Sun, 21 Apr 2024 15:10:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 43LFACte2724419; Sun, 21 Apr 2024 11:10:12 -0400 From: Tom Lane To: Tomas Vondra cc: PostgreSQL Hackers Subject: Re: createdb compares strategy as case-sensitive In-reply-to: References: <90c6913a-1dd2-42b4-8365-ce3b09c39b17@enterprisedb.com> <2568919.1713645640@sss.pgh.pa.us> <86ed7de6-2f04-4c38-ae82-7927da98e38e@enterprisedb.com> <2581132.1713651555@sss.pgh.pa.us> Comments: In-reply-to Tomas Vondra message dated "Sun, 21 Apr 2024 14:35:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2724417.1713712212.1@sss.pgh.pa.us> Date: Sun, 21 Apr 2024 11:10:12 -0400 Message-ID: <2724418.1713712212@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > On 4/21/24 00:19, Tom Lane wrote: >> I'm not suggesting that this is an interesting security vulnerability, >> because if you can control the arguments to createdb it's probably >> game over long since. But wrapping the arguments is good for >> delivering on-point error messages. So I'd add a fmtId() call to >> LOCALE_PROVIDER too. > OK, the attached 0001 patch does these three things - adds the fmtId() > for locale_provider, make the comparison case-insensitive for strategy > and also removes the comma from the hint. LGTM. > The createdb vs. CREATE DATABASE difference made me look if we have any > regression tests for CREATE DATABASE, and we don't. I guess it would be > good to have some, so I added a couple, for some of the parameters, see > 0002. But there's a problem with the locale stuff - this seems to work > in plain "make check", but pg_upgrade creates the clusters with > different providers etc. which changes the expected output. I'm not sure > there's a good way to deal with this ... Probably not worth the trouble, really. regards, tom lane