Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C0F67288154 for ; Wed, 9 Nov 2011 07:10:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 01817-02 for ; Wed, 9 Nov 2011 11:10:14 +0000 (UTC) X-Greylist: delayed 00:08:23.046167 by SQLgrey-1.8.0-rc2 Received: from fallback7.mail.ru (fallback7.mail.ru [94.100.176.135]) by mail.postgresql.org (Postfix) with ESMTP id BB495288153 for ; Wed, 9 Nov 2011 07:10:13 -0400 (AST) Received: from smtp8.mail.ru (smtp8.mail.ru [94.100.176.53]) by fallback7.mail.ru (mPOP.Fallback_MX) with ESMTP id 3362D6B08405 for ; Wed, 9 Nov 2011 15:01:55 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:Mime-Version:Message-ID:Subject:To:From:Date; bh=UgdlAHldQZbejfABjwkx2ubknJESEglPM1MKszEbayg=; b=hCZev1CiK55h2OIwkBc0wzAP95rfeTb5WnZiz+UMCigEU8vnNpudxO4SWJ6LxjWOEYt1DFFo9hl6VqY33ft0tG+IFxCP77zTrCxCNXY2feh/i/xFnMPMAnOSmSJsEKgp; Received: from [95.174.102.250] (port=46386 helo=localhost) by smtp8.mail.ru with asmtp id 1RO5ue-0002HT-00 for pgsql-admin@postgresql.org; Wed, 09 Nov 2011 15:01:48 +0400 Date: Wed, 9 Nov 2011 15:02:25 +0400 From: "Ruslan A. Bondar" To: pgsql-admin@postgresql.org Subject: How to deal with corrupted database? Message-ID: <20111109150225.076c2f38@list.ru> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: Ok X-Mras: Ok X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.5 tagged_above=-10 required=5 tests=BAYES_05=-0.5, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201111/22 X-Sequence-Number: 38616 Hello all. This is a first time I receive such an issue. My database was corrupted some way. When I'm trying to access the database via psql I receive: root@udb:/etc/bacula# psql -U bacula psql: FATAL: could not read block 0 in file "base/16387/86057840": read only 0 of 8192 bytes So I want to drop it, and recover from backup. But when I'm trying to drop the database I see: postgres=# drop database bacula; ERROR: could not access status of transaction 15892843 DETAIL: Could not open file "pg_subtrans/00F2": No such file or directory. Is there any way to recover the database to working state, or drop it? OS: Linux Debian Sid postgres version: 9.0.4 uname: Linux udb 2.6.32-5-xen-686 #1 SMP Tue Oct 19 17:09:04 UTC 2010 i686 GNU/Linux