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 1rycxk-00HCl6-II for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Apr 2024 19:34:56 +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 1rycxj-00FnnJ-3N for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Apr 2024 19:34:55 +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 1rycxi-00Fnn9-OJ for pgsql-hackers@lists.postgresql.org; Sun, 21 Apr 2024 19:34:54 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rycxf-002DXa-9C for pgsql-hackers@lists.postgresql.org; Sun, 21 Apr 2024 19:34:53 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2da08b06e0dso44007261fa.2 for ; Sun, 21 Apr 2024 12:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1713728089; x=1714332889; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/iUV0nY+MfC3W9gMwKN/IrQCSt2kL4OgR9tyViFcqgM=; b=j96SPiVnxx5fwbX7rTkqRQue9DQK4okioeCYPZxb7jI3N6gKByy/ZNPxANOLDrLAHt 7kyczZPvEUYa4a4LgJKRymp8mMg62iYhUfL4ElOL5uJm70jKuqL3dz9leiZPkrOeSQuT vwTKWkSa1AXzPChawzKp1WIsADxc7ZscsckYhyDJ1oZ6kh+V7yIBHXhqOdZTLx9goAPF zQlXDLOc6wV7dREHcr7EF9AeSg9A3hnwqDd6kJHCJJJWsbBtWIBtFZzRAS/TfgVMXnMq R7U4l1u6L5EalUXKBxiAigkknhqngVh+GnslfSHqqdpc8f67/1ddVJPqjIodjJy6VE3A dJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713728089; x=1714332889; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/iUV0nY+MfC3W9gMwKN/IrQCSt2kL4OgR9tyViFcqgM=; b=A72J7YHryUNuGVNxHqWdCMZL35nU5CFH65tLiwA5IdtiO7kfIwwZ77gfzU8v3VxgVP hov0PdQAQaktZjBnAN0Tqr3csmNOfGzmHFp9dj+FNcyvTmRUITJz+ypOnjdt5ZJ4h0Cw 79yYz3ADMzt+v3HJ6iPXOHxjl5lFXM917YmkV2u5uvSz+VrhJ5vWtVNE2uNJF0tuDRLz uNKRcsWVMn1thaYGFo4QCHj5OhjH0jgw9Gkv/7RQI5niFOJDdnDYWo7WXp4aK1HJLAhV V4iPOv8ra7FqiX8kNqUqKO2uE4UFVgSLBAasB+2+0k0nuLo/+QiWntZhNyl9W5OcuBDd qIyQ== X-Gm-Message-State: AOJu0YxiUDwqvEFJBrOrYORASAjZhNDO+r2zdlNdpYaTCckxtoW2toQu yMCe+r3943wONsg4y4NnMSkNddINYVRewS6+CbF52aR8c+GphuSgWuzZQikyNYRfJlLcy4Pvqg4 = X-Google-Smtp-Source: AGHT+IHQHcXxF+a0Mwez3/xLuM/EovowSdqz7flzorlR4bKQNW6X3G8HdFUrx4S14B2L65TvanpYjQ== X-Received: by 2002:a2e:95da:0:b0:2d8:d23a:f440 with SMTP id y26-20020a2e95da000000b002d8d23af440mr4903285ljh.6.1713728089298; Sun, 21 Apr 2024 12:34:49 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0041a3f700ccesm2260082wmn.40.2024.04.21.12.34.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Apr 2024 12:34:48 -0700 (PDT) Message-ID: <8ea8e69f-4462-44bc-b06e-dc94afb2169c@enterprisedb.com> Date: Sun, 21 Apr 2024 21:34:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: createdb compares strategy as case-sensitive To: Tom Lane Cc: PostgreSQL Hackers 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> <2724418.1713712212@sss.pgh.pa.us> Content-Language: en-US From: Tomas Vondra In-Reply-To: <2724418.1713712212@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/21/24 17:10, Tom Lane wrote: > 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. > 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