pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: createdb compares strategy as case-sensitive
Date: Sun, 21 Apr 2024 21:34:47 +0200
Message-ID: <8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com> (raw)
In-Reply-To: <2724418.1713712212@sss.pgh.pa.us>
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>
	<cd9fd588-f1c4-4379-9bdb-ba5899d831cc@enterprisedb.com>
	<2724418.1713712212@sss.pgh.pa.us>

On 4/21/24 17:10, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@enterprisedb.com> 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.
> 

Pushed, after tweaking the commit message a bit.

>> 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.
> 

Agreed.



regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (7+ messages)

Message-ID: <8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com>
Permalink:  ../8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com/
Also on:    postgresql.org/message-id/8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com

 · 

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: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: createdb compares strategy as case-sensitive
  In-Reply-To: <8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox