Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 434D3632611 for ; Mon, 26 Jan 2009 13:16:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72715-04 for ; Mon, 26 Jan 2009 13:16:47 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mail.postgresql.org (Postfix) with ESMTP id 6CA16632610 for ; Mon, 26 Jan 2009 13:16:47 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id 16so3399838fgg.23 for ; Mon, 26 Jan 2009 09:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=sFvUeTuGMlE2gkuX3Ntq0zcF+8Vvjaw0LcnDFfab9Mo=; b=eC78ltbCBHuxpDqSq3YwrT93tNDgoWGdrfphVL0IMagang7rHFXaSbPR09wnYoBnBK /XD+ugLyY4Ge1PIUF3xi85Zsv9JWfbbvGMC1gQzrNlWbr2kexrrNZvTiPNY3vZ3Lu9Tw W6wE/DLPnZYDcfrD2JRgbDUSMZB+n3dkztZpk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=XDVyRboaPG+Y/RGFvzpJ23saeDDoZtXNTlS9wDffKbj0xlL3mxXwTGdvzo8SMoKGI4 WKfUpZ/4m96/NOSFUwboXtggguMglQEx3JS7SQdsSq3HmQoRFILTxFhXa9ISAOyDq6mb sLqevEWo/+/4N+QV6gWLzgS4zKs6eWXm6T5Fk= MIME-Version: 1.0 Received: by 10.223.113.199 with SMTP id b7mr2892885faq.83.1232990206061; Mon, 26 Jan 2009 09:16:46 -0800 (PST) Date: Mon, 26 Jan 2009 18:16:46 +0100 Message-ID: <26ce3de40901260916g1fccacb2p14db55064cd9feab@mail.gmail.com> Subject: Recover with main/base files From: Sylvain Avril To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/143 X-Sequence-Number: 31190 Hello, I use postgresql 8.1 on a debian server with a /var JFS filesystem. After a crash of this FS (due to hardware instability: PSU), the /var/lib/postgresql/8.1/main folder was missing and its files were found under /var/lost+found. We have a full daily backup of this DB but I try to recover data from the morning it crashed. This is what I was able to recover : - main/base apparently without missing files ! - main/pg_xlog : I don't have these files names (but I can guess it from PG start errors) and I don't know in which order I've have to name them - main/pg_clog files 0000 and 0001 but not 0003 which I replaced with a zero padded file - main/pg_multixact - main/global/pg_control But the global folder content was not found. I probably have piece of it but I wasn't able to identify them except for pg_control. I tried to restore all the files over a base debian installation and then inserting a record in pg_database table like that : insert into pg_database (datname, datdba, encoding, datistemplate, datallowconn, datconnlimit, datlastsysoid, datvacuumxid, datfrozenxid, dattablespace) VALUES ( 'ex1', 10, 8, 'f', 't', -1, 10792, 499, 499, 1663); PG started without error and I can connect to the DB created but \dt show me nothing. Do you have alternatives to restore a db from main/base files ? If you have a method to reorder pg_xlog files, it interest me too. Thank you