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 1rDBx9-001D60-49 for pgsql-general@arkaria.postgresql.org; Tue, 12 Dec 2023 23:14:15 +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 1rDBx7-009FYF-8p for pgsql-general@arkaria.postgresql.org; Tue, 12 Dec 2023 23:14:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDBx6-009FXi-To for pgsql-general@lists.postgresql.org; Tue, 12 Dec 2023 23:14:12 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDBx3-00A6YY-Fl for pgsql-general@lists.postgresql.org; Tue, 12 Dec 2023 23:14:11 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 29E1F3200AFF; Tue, 12 Dec 2023 18:14:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 12 Dec 2023 18:14:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1702422846; x=1702509246; bh=KUN8sReV6q2BsWTl76Pmjpz5SbUxjRm9HvGrfQRST6c=; b= QbUBkpG/1TOxG977pPY7MmToV66giGoUE7udOCA4Dmla6zPv080u7aeKSvibfxzR ObacaSh5IQMj10uMGiPJAChQ0N2GtZFEIy46q52fpPeyHI9VDu+UnC2HDw9oUP2k 1qaB+VzPQ2xR1o2V9oHS5b6Z1gLjuGDi2Iey+wUryn77GHXKvQZQGWvRifLyrWml Kt3rmXmvzWjy/eAW5BLV5IaYrXpo6+xCnVVv341WlA5HeB2e69b+gcrtpXPNEBsf sUOx/KaYbpgQGMmjeRUqaq6dhp2Gi54Ge5BXfZt5QZxGHZ1e2XaIw9SF+mxA1dB1 AhO9PjM8pqHCj2u25ZEq0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1702422846; x= 1702509246; bh=KUN8sReV6q2BsWTl76Pmjpz5SbUxjRm9HvGrfQRST6c=; b=s xvhoHnncHBBAqG4nVbTuH1Wc4jBGjUiVs+L0uSJw/0JHdWQPGxfHDib2R3k7hRib lIDDp0Pdb6h210VYJHFSGF1KkbS90YUEd6CyzSnoKoLeVeNIOOck1UNN5BMemozq AuLuS0VnoRQRs9sPslbgdKABW7HNOEnsT8K+UGUfQ/v97dh5OZkKHvoerEmtY04v hqCsBgH+/VzFPgm6ir41Af6nlrZeSp6C934nAuCQz7TGOuuUr99W4qAnwis6xcxf Sfzd3UpB29F3d0Dqs60AGiJ9yuyNO2F/0IIkQG15bysoSBn/gNKwWqUk3DgzKv/O rXUPUdS+UYnwW7Sa4l3Gg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelhedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepgfdufeekhfevfeelveeiueevhedvuddukeduvddv lefhueeuieejtdeuvdevvdeunecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Dec 2023 18:14:05 -0500 (EST) Message-ID: <763a967a-6ac9-45ed-bdf2-fd9385ee8f35@aklaver.com> Date: Tue, 12 Dec 2023 15:14:05 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: how can I fix my accent issues? Content-Language: en-US To: Igniris Valdivia Baez , Laurenz Albe Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: 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 12/11/23 10:54, Igniris Valdivia Baez wrote: > hello to all, thanks for your answers i've changed the encoding using this: > ALTER DATABASE testdb > SET client_encoding = WIN1252; > > now when we try to select data from a table we get this error: > > ERROR: character with byte sequence 0xe2 0x80 0x8b in encoding "UTF8" > has no equivalent in encoding "WIN1252" SQL state: 22P05ERROR: > character with byte sequence 0xe2 0x80 0x8b in encoding "UTF8" has no > equivalent in encoding "WIN1252" SQL state: 22P05 > > i want to clarify that the postgres on dev is in a docker environment > that already have databases in it so we can't change encoding for the > hole container You don't have to: https://www.postgresql.org/docs/current/manage-ag-templatedbs.html Another common reason for copying template0 instead of template1 is that new encoding and locale settings can be specified when copying template0, whereas a copy of template1 must use the same settings it does. This is because template1 might contain encoding-specific or locale-specific data, while template0 is known not to. > > thanks in advance > > El sáb, 9 dic 2023 a las 1:01, Laurenz Albe > () escribió: >> >> On Fri, 2023-12-08 at 23:58 -0500, Igniris Valdivia Baez wrote: >>> hello, I have an ETL process collecting data from a postgresql >>> database and xls files and inserting in a postgresql database that >>> process occurs great in a local DB in postgres 14 with UTF8 >>> codification and Spanish_Cuba.1952 collation but when I execute that >>> process in dev which is in postgres 15 and UTF8 with collation >>> en_US.utf8 the words with accents and ñ looks like an interrogation >>> symbol, what can I do to fix this? >> >> If the data you are sending are encoded in WINDOWS-1252 (I assume that >> "1952" is just a typo), you should set the client encoding to WIN1252, >> so that PostgreSQL knows how to convert the data correctly. >> >> You can do that in several ways; the simplest might be to set the >> environment variable PGCLIENTENCODING to WIN1252. >> >> Yours, >> Laurenz Albe > > -- Adrian Klaver adrian.klaver@aklaver.com