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 1nCJFu-0004w7-Ss for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 10:40:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCJFs-00069B-Rh for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 10:40:52 +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 1nCJFs-000691-IA for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 10:40:52 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCJFp-00081O-BI for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 10:40:51 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B7CB63201F9F; Tue, 25 Jan 2022 05:40:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 25 Jan 2022 05:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=hm7kW881imFkBktfkxIzGS0HuFk6hM8Qe3EW1mTaU 9g=; b=mSxn1/SE+gqRQ0rg8qq0tvmLLi3amsM/PGHP6Z0gE1OZ6YvYwKjHfRlxL 8fh2O7+/AxGrG4epxi1UK50Sqb/NIgFbTvvf1333Mdr9l+MXbdDd/x94RTyrZ9sD EbmGD4PTfBtvfxV6tOO+gCTyLL7w8e4WhXdF6fcoch7O08GIOqwXR5Fy9TYVMjeH u1tXfFT3wKXqA4KRvRlp7v9CpX7SdiIO93TvvEmmNs1HfwrLfLJG02sFa1whcMnx bWGgerIdfO6pwEqJ2ovzVqQdS3RBKvhnRNVb8XWtlICEOARth55z/VKLHyPkXT+e jirunNLkY+3tgv3mVCSXPkhJFIbmQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdelgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelgfetfeeitdelleeggeej vefhueetfedvtdejheevueeifeegvdfhueeludetueenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Jan 2022 05:40:45 -0500 (EST) Message-ID: <639e0abd-ea82-b751-bfba-5166a7a1b304@enterprisedb.com> Date: Tue, 25 Jan 2022 11:40:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: WIN32 pg_import_system_collations Content-Language: en-US To: Dmitry Koval , =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= Cc: PostgreSQL Hackers References: <0050ec23-34d9-2765-9015-98c04f0e18ac@postgrespro.ru> From: Peter Eisentraut In-Reply-To: <0050ec23-34d9-2765-9015-98c04f0e18ac@postgrespro.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.01.22 22:23, Dmitry Koval wrote: > +/* > + * Windows will use hyphens between language and territory, where POSIX > + * uses an underscore. Simply make it POSIX looking. > + */ > + hyphen = strchr(localebuf, '-'); > + if (hyphen) > +    *hyphen = '_'; > > After this block modified collation name is used in function > > GetNLSVersionEx(COMPARE_STRING, wide_collcollate, &version) > > (see win32_read_locale() -> CollationFromLocale() -> CollationCreate() > call). Is it correct to use (wide_collcollate = "en_NZ") instead of > (wide_collcollate = "en-NZ") in GetNLSVersionEx() function? I don't really know if this is necessary anyway. Just create the collations with the names that the operating system presents. There is no requirement to make the names match POSIX. If you want to make them match POSIX for some reason, you can also just change the object name but leave the collcollate/collctype fields the way they came from the OS.