Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWh9E-00034P-22 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Sep 2022 16:46:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oWh9C-0001sb-Sk for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Sep 2022 16:46:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWh9C-0001sS-JW for pgsql-hackers@lists.postgresql.org; Fri, 09 Sep 2022 16:46:30 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oWh99-0002yP-JV for pgsql-hackers@postgresql.org; Fri, 09 Sep 2022 16:46:29 +0000 Received: by mail-il1-x134.google.com with SMTP id b17so1120895ilh.0 for ; Fri, 09 Sep 2022 09:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=FsSewMHfLSa2JTTGpcnv9Y0V1kNO4BNoGzMjIMfFTmM=; b=j4USL1qYTTShGsigQ9s9PjlpsWw3O+I99F+oSbcIKwNXUrza87VLQQ8VxBO8AJFJpy nnCo/AP+AdG7/Q3ddSyky4ytmmvuWMbzPHszr5YOSFOY8nqJF2D/eZSf2+F1WpMPWrut L+cFrodx7TSx/bzd1p8efGUGOvGDaXQfe0gtNp4eLeWbyyFWaz57a3BCmf5XMipKVk+X 43Ib0vViAFkzSBVptvA3bBN4aBGvVHvnd1SkAafmZca9QXUpnqZjIOidWepYTjU9zFbc QzkzkcZRC6i7OY2OoVWQwxOcymJmkCyyDzr9SamD9us1o6vqQj0GCOUKMyNtkxLErbXF lTDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=FsSewMHfLSa2JTTGpcnv9Y0V1kNO4BNoGzMjIMfFTmM=; b=Bk6it6pbZBQRCnGRiyxoF26h4py6TH1nkYrT4+GR09VhlTJugX8EDlaLFeSH/w0lFQ LPBGaKsIplewVuNgO3JjPBCIe2fCsLf3yXMhF8gztoH690zTQlcRAEF3sZeEHWVnzTSH BdBnxKVaeGfZvZzdMRXNWuj/hzdOvF+Ww0RkuWEVp/9PG1p7OF/xjgTDVixbHxn3LUbe VktbntDGebjCsdHkw/qQTTS++m02TiRqHro8ibGLhI3B5xeIjTl+ewM76iBzcV8kw6ls SgorFS1r57LLYVryABsfZ7xruQdhlB5TvQk3dwlH3yB9U/Q2OfWIoZ/vTAvrjO+yWnMR aHPQ== X-Gm-Message-State: ACgBeo3A51eMzos08Xn0LX2uQqYxJ62haq7Ky/8axjsimnwzhtMwZto/ otFKE3vjjKyImkFxqoLdwqkSFQ== X-Google-Smtp-Source: AA6agR5YJVd8rOynAa/kbW4DD2Pf7x+jHOzK/i0oRGHQWzSeQ4dSMcgaac7xZqAavqJwQrsQFDilzg== X-Received: by 2002:a92:c54f:0:b0:2f1:cc3b:90ee with SMTP id a15-20020a92c54f000000b002f1cc3b90eemr4806012ilj.118.1662741986883; Fri, 09 Sep 2022 09:46:26 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l13-20020a056e021c0d00b002dd0bfd2467sm332279ilh.11.2022.09.09.09.46.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2022 09:46:26 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 7DA6D801044; Fri, 9 Sep 2022 11:46:25 -0500 (CDT) Date: Fri, 9 Sep 2022 11:46:25 -0500 From: Justin Pryzby To: Marina Polyakova Cc: pgsql-hackers@postgresql.org, Peter Eisentraut , Julien Rouhaud , Daniel Verite , AndrewBille@gmail.com, michael@paquier.xyz Subject: Re: ICU for global collation Message-ID: <20220909164625.GN31833@telsasoft.com> References: <20220628013205.GH19662@telsasoft.com> <7d74b2d7-7fc6-f55b-3f77-c0e05569b64e@enterprisedb.com> <7ad26354e75259f59c4a6c6997b8ee32@postgrespro.ru> <20220824085923.jro5ao2m5b4mdll5@jrouhaud> <13468bee-a5b4-65aa-932c-c12584f4458d@enterprisedb.com> <7c99c132dc9c0ac630e0127f032ac480@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c99c132dc9c0ac630e0127f032ac480@postgrespro.ru> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk In pg14: |postgres=# create database a LC_COLLATE C LC_CTYPE C LOCALE C; |ERROR: conflicting or redundant options |DETAIL: LOCALE cannot be specified together with LC_COLLATE or LC_CTYPE. In pg15: |postgres=# create database a LC_COLLATE "en_US.UTF-8" LC_CTYPE "en_US.UTF-8" LOCALE "en_US.UTF-8" ; |CREATE DATABASE f2553d430 actually relaxed the restriction by removing this check: - if (dlocale && (dcollate || dctype)) - ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("conflicting or redundant options"), - errdetail("LOCALE cannot be specified together with LC_COLLATE or LC_CTYPE."))); But isn't the right fix to do the corresponding thing in createdb (relaxing the frontend restriction rather than reverting its relaxation in the backend). diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c index e523e58b218..5b80e56dfd9 100644 --- a/src/bin/scripts/createdb.c +++ b/src/bin/scripts/createdb.c @@ -159,15 +159,10 @@ main(int argc, char *argv[]) exit(1); } - if (locale) - { - if (lc_ctype) - pg_fatal("only one of --locale and --lc-ctype can be specified"); - if (lc_collate) - pg_fatal("only one of --locale and --lc-collate can be specified"); + if (locale && !lc_ctype) lc_ctype = locale; + if (locale && !lc_collate) lc_collate = locale; - } if (encoding) { BTW it's somewhat crummy that it uses a string comparison, so if you write "UTF8" without a dash, it says this; it took me a few minutes to see the difference... postgres=# create database a LC_COLLATE "en_US.UTF8" LC_CTYPE "en_US.UTF8" LOCALE "en_US.UTF8"; ERROR: new collation (en_US.UTF8) is incompatible with the collation of the template database (en_US.UTF-8)