Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jIcFJ-00014O-NN for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2020 18:01:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jIcFI-0006De-6s for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2020 18:01:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jIcFH-0006Bo-Pb for pgsql-general@lists.postgresql.org; Sun, 29 Mar 2020 18:01:15 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIcFF-0004aI-98 for pgsql-general@postgresql.org; Sun, 29 Mar 2020 18:01:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C2220433; Sun, 29 Mar 2020 14:01:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 29 Mar 2020 14:01:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=P fthGSmUPsq8I6CRvP9m0GTNQSGo6jSEVit5FjpbLbM=; b=aDWPTOaAoGyGUN+f1 2TbgxA9rs3xoQTNEI2f9+0o3osOigNJZPT7uQhHdVFzTNa5U+AeeS9tls7/RShX9 qdC8MzCoEIhT3u6dkskwVz1fSaj+nLXAKaPIKDEiqUDcSKbxfvhrrMZB3SPZd1Ym 45UXf3+KWG6MXWakKy5KblWxwQ7E3ufj2uWc3dLGuZtXgs2kb9GBszf0u3ne6LUx OaEh+dZgdtulotVP05iBhNuAyxCj1FnEJoqPyBWLqFnEcwu0A7QymuuY+WCs9sze sqbp6fKNTR3NbkmHL4ps4YEvsPSv65qDXcvTwjM2oPo+iRFtbaxhC3LP/Zt+ba/R JIqbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=PfthGSmUPsq8I6CRvP9m0GTNQSGo6jSEVit5FjpbL bM=; b=myaGKimMNkWAIZiZtNt1uRiQ+xb8RSDeHZt+oIKNRPD6lxgTGcVclSh52 qe2RyRbbWYwi2JvTNWSFirr9BS9mAmnSb32VtHCUK0ARlVW8alk4EES56n8ZNCCY pGtGqfI0vmTBT92T8Bhk43krNyBhtcgNHMp+wrwPL9fixZ4pVaAY3kY1iLz1RVAd Am9++q4I7mZ/SCR4Y/uixikncp5yuU8Gw9T84eX6cKEye/d48Dg7bZBR0v9pK3u0 unCdxV6i2dpc8W2XCkJtYELST2r1ZKi15XxHTW1IFmd2vWhsiOLu5D4XiGYyzROA zCGCzmY/jGWqRFcSYBeAvfSAxDerA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeifedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepshhtrggtkhhovh gvrhhflhhofidrtghomhdpphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejhedrudej vddrledtrdelvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (75-172-90-92.tukw.qwest.net [75.172.90.92]) by mail.messagingengine.com (Postfix) with ESMTPA id 7CFFA328005D; Sun, 29 Mar 2020 14:01:10 -0400 (EDT) Subject: Re: could not determine encoding for locale "et_EE.UTF-8": codeset is "CPUTF-8" in pg_restore To: Andrus , Tom Lane Cc: pgsql-general References: <22672.1585442578@sss.pgh.pa.us> <1046C47572F54F1BA5A726A49BAC6F3C@dell2> From: Adrian Klaver Message-ID: <2a30dc9b-79e1-69c6-3360-3cf9ac326b7e@aklaver.com> Date: Sun, 29 Mar 2020 11:01:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1046C47572F54F1BA5A726A49BAC6F3C@dell2> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/29/20 1:02 AM, Andrus wrote: > Hi! > >> Generally speaking, locale names from Unix systems won't work at all on >> Windows.  You need to create the database manually with whatever seems >> to be the closest Windows locale match, and then restore its contents >> without using --create. > > This is unattended script running in every night from .bat file. Per my previous post, you might try adding something like: cmd.exe /c chcp 1257 to the top of the batch file. This idea came from here: https://stackoverflow.com/questions/20794035/postgresql-warning-console-code-page-437-differs-from-windows-code-page-125 > > How to replace pg_restore --create  option with   psql and/or createdb > calls > and specify proper locale for them ? > > Currently everthing has "Estonian_Estonia.1257"  locale in windows. > Which locale name should be specified in Windows instead of this? > Or maybe creating new template with proper encoding or changing > template0 encoding helps? If I am following the error correctly then the issue is that the Postgres console programs are using CP755 and that is not something for which there is an automatic conversion: https://www.postgresql.org/docs/12/multibyte.html#id-1.6.10.5.7 There is a conversion for 1257 clients so having your console run as 1257 should solve the problem. Someone with more current experience on Windows will need to comment on whether that is the viable or best solution. > > Andrus. > > -- Adrian Klaver adrian.klaver@aklaver.com