Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flUVV-0000Df-JJ for pgsql-admin@arkaria.postgresql.org; Fri, 03 Aug 2018 07:28: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 1flUVU-0007rT-1M for pgsql-admin@arkaria.postgresql.org; Fri, 03 Aug 2018 07:28:16 +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.89) (envelope-from ) id 1flUVT-0007rL-QX for pgsql-admin@lists.postgresql.org; Fri, 03 Aug 2018 07:28:15 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1flUVQ-0005Rw-KK for pgsql-admin@postgresql.org; Fri, 03 Aug 2018 07:28:15 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 3B4BA48EEF; Fri, 3 Aug 2018 09:28:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id nEMWO7LjdeMl; Fri, 3 Aug 2018 09:28:09 +0200 (CEST) Message-ID: <1533281288.2479.5.camel@cybertec.at> Subject: Re: PostgreSQL 9.3 - reindex problem From: Laurenz Albe To: "For@ll" , pgsql-admin@postgresql.org Date: Fri, 03 Aug 2018 09:28:08 +0200 In-Reply-To: References: 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 For@ll wrote: > I have problem with postgresql-9.3 in our clients. They suddenly lost > power connection and all servers halt.. I repiar xfs filesystem on > CentOS7 postgresql partition. Now when I want run reindex database I > receive error: > > reindexdb -d ex200 > NOTICE: table "pg_catalog.pg_class" was reindexed > reindexdb: reindexing of database "ex200" failed: ERROR: invalid page > in block 101 of relation base/157934/12685 > > I want to try run dump and save database on plaintext but when I start > pg_dump it's hang... > > pg_dump -a -v -d ex200 > ex200.sql > pg_dump: last built-in OID is 16383 > pg_dump: reading extensions > pg_dump: identifying extension members > pg_dump: reading schemas > pg_dump: reading user-defined tables > pg_dump: reading user-defined functions > > Any ideas what can I do.. Client told me they have a backup from 2 > montgs ago.... That all looks like data corruption. PostgreSQL should survive a crash just fine; it seems like your databases are running with unsafe storage (that doesn't honor fsync). If the backup from 2 months ago is a physical backup and you have WAL archives, you can simply recover up to now. If it is just a pg_dump, then you can either live with 2 months of data loss or you hire professionaly that might be able to get some of your data back. If you go for the second option, take a copy of the broken database before doing anything else with it. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com