Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPBLO-0000QY-5a for pgsql-admin@arkaria.postgresql.org; Tue, 11 Aug 2015 15:20:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZPBLN-0005zP-Lp for pgsql-admin@arkaria.postgresql.org; Tue, 11 Aug 2015 15:20:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPBJk-000394-DH for pgsql-admin@postgresql.org; Tue, 11 Aug 2015 15:18:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPBJh-0004r1-Gn for pgsql-admin@postgresql.org; Tue, 11 Aug 2015 15:18:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t7BFIEUe020881; Tue, 11 Aug 2015 11:18:14 -0400 From: Tom Lane To: dbadmin@nqadmin.com cc: pgsql-admin@postgresql.org Subject: Re: Postgresql 9.4.4 - ERROR: invalid byte sequence for encoding "UTF8": 0x92 In-reply-to: <55CA0DEA.80203@nqadmin.com> References: <55CA0DEA.80203@nqadmin.com> Comments: In-reply-to Prasanth Reddy message dated "Tue, 11 Aug 2015 09:59:54 -0500" Date: Tue, 11 Aug 2015 11:18:14 -0400 Message-ID: <20880.1439306294@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Prasanth Reddy writes: > I am currently running 9.1.9 and trying to upgrade to 9.4. I have done a dump and restore, when I start my java application I am getting the below error. The server uses SQL_ASCII encoding and the > client encoding is UTF8. There are some invalid characters in the database but this has not caused a problem in the current version or 9.3 (tried a restore in 9.3 and the application works fine). > ERROR: invalid byte sequence for encoding "UTF8": 0x92 > STATEMENT: SELECT * FROM client_data WHERE status_code = 0 ORDER BY client_name, description You need to fix the encoding errors in your data. 9.4 is intentionally less lax about that than prior versions. Or, if you really want the database to be totally encoding-ignorant, use SQL_ASCII as both client and server encoding. But if you have the client declared to use UTF8, the server will try not to send anything that isn't valid UTF8. I believe the specific change that's biting you is Author: Tom Lane Branch: master Release: REL9_4_BR [49c817eab] 2014-02-23 15:22:50 -0500 Plug some more holes in encoding conversion. Various places assume that pg_do_encoding_conversion() and pg_server_to_any() will ensure encoding validity of their results; but they failed to do so in the case that the source encoding is SQL_ASCII while the destination is not. We cannot perform any actual "conversion" in that scenario, but we should still validate the string according to the destination encoding. Per bug #9210 from Digoal Zhou. but there were some others of the same ilk in 9.4. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin