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.89) (envelope-from ) id 1h8hS4-00067E-MD for pgsql-general@arkaria.postgresql.org; Tue, 26 Mar 2019 08:28:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8hS3-0002JH-CZ for pgsql-general@arkaria.postgresql.org; Tue, 26 Mar 2019 08:28:55 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8hOq-0001GO-C8 for pgsql-general@lists.postgresql.org; Tue, 26 Mar 2019 08:25:36 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8hOn-0000dK-Lw for pgsql-general@lists.postgresql.org; Tue, 26 Mar 2019 08:25:35 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 02D464BBB5; Tue, 26 Mar 2019 09:25:30 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id 7ftucni7-VaR; Tue, 26 Mar 2019 09:25:25 +0100 (CET) Message-ID: <36fb4cf70a723ffe5ffe9dba850357fa0bc97b18.camel@cybertec.at> Subject: Re: postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8" From: Laurenz Albe To: Thomas Tignor , "pgsql-general@lists.postgresql.org" Date: Tue, 26 Mar 2019 09:25:24 +0100 In-Reply-To: <1080815989.10741938.1553539577631@mail.yahoo.com> References: <1080815989.10741938.1553539577631.ref@mail.yahoo.com> <1080815989.10741938.1553539577631@mail.yahoo.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Tignor wrote: > We are experiencing intermittent DB corruption in postgres 9.5.14. We are trying to > identify and eliminate all sources. We are using two independent services for data > replication, Slony-I v2.2.6 and a custom service developed in-house. Both are based > on COPY operations. DB corruption is observed when COPY operations fail with an error > of the form: 'invalid byte sequence for encoding "UTF8"'. > This occurs with a frequency ranging between a few days and several weeks. It might be a storage problem, but it could also be a problem with how the data get into the database in the first place. I would consider it unlikely that there is a bug in the TOAST code that changes just one byte. You could use block checksums to see if the storage is at fault, but unfortunately it requires an "initdb", dump and restore to switch to checksums. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com