Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TaSeD-0005MB-8n for pgsql-admin@postgresql.org; Mon, 19 Nov 2012 14:48:29 +0000 Received: from mail2.charite.de ([141.42.206.200]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TaSe6-0002Dw-Ta for pgsql-admin@postgresql.org; Mon, 19 Nov 2012 14:48:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mail2.charite.de (Postfix) with ESMTP id 3Y4tFy21y4z1tHd for ; Mon, 19 Nov 2012 15:48:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=charite.de; h= content-transfer-encoding:content-type:content-type:mime-version :user-agent:from:from:subject:subject:date:date:message-id :received:received:received; s=default; t=1353336496; x= 1355150897; bh=HHYU893G/rDaAq+G7v9oY5KeTzjnswxkL6qZumjw26A=; b=h s36HoH4GP1RZv6nDGf0YKCxwNpGvEcmL1sny2BI2wAZoyKQ2lTwzx3K9vcXB/Jk7 ERY3oW+6WNn638A+i9/USLnsEKKFSWtTVUCVkfuIM1GB1fnUUXqOvl1RIIaTmzfD An/BdxTb3iMoe+AaYosKfYjBkHvvP9JAwYdfWk6sac= Received: from postamt.charite.de (postamt.charite.de [141.42.206.36]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail2.charite.de (Postfix) with ESMTPS for ; Mon, 19 Nov 2012 15:48:16 +0100 (CET) Received: from webmail.charite.de (webmail.charite.de [141.42.206.38]) by postamt.charite.de (Postfix) with ESMTP id 3Y4tFK6fnQz2r13 for ; Mon, 19 Nov 2012 15:47:49 +0100 (CET) Received: from 88.75.204.82 (SquirrelMail authenticated user akarlsta) by webmail.charite.de with HTTP; Mon, 19 Nov 2012 15:47:49 +0100 Message-ID: <581030c75139182bb216efbd121033da.squirrel@webmail.charite.de> Date: Mon, 19 Nov 2012 15:47:49 +0100 Subject: Postgresql - restore database from physical storage From: =?iso-8859-1?Q?=22Anja_Karlst=E4dt=22?= To: pgsql-admin@postgresql.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -5.3 (-----) X-Archive-Number: 201211/101 X-Sequence-Number: 40346 Dear PGSQL-Admin, Due to a system crash I had to reinstall PostgreSQL 8.4 without being abl= e to make a dump of my database. However, I do have a complete backup of the postgresql main directory including the physical storage (/var/lib/postgres/8.4/main). Is it possible to restore the database from this backup? After reinstallation of postgres (8.4 - 17.11.2012) I moved all files fro= m the original main directory back into the new directory and connected to the database as following: postgres@user:/home/user$ /usr/lib/postgresql/8.4/bin/pg_ctl -D /var/lib/postgresql/8.4/main/ -l /var/log/postgresql/postgresql-8.4-main.log start > server starting After entering psql the list of databases is displayed as following: postgres template 0 template 1 The pg_database file shows: > "template1" 1 1663 648 > "template0" 11563 1663 648 > "postgres" 11564 1663 648 The "original" pg_database changed from my "original" version including all databases (total=3D6) to the given default version. Then I created two different databases as "test" and "test2": > "test" 16384 1663 648 > "test2" 16386 1663 648 The OID 16385 is obtained by one of my "original" databases and obviously not included in this pg_database list. If I try to set the OID from "test" to 16385 and connect to this database the OID entry is changed back to 16384 and the database is empty. The permissions (owner, group) for all files in the main directory are se= t to postgres. Could you please tell me how to restore my database or connect to it in order to save the data from the tables? Thank you very much for reading this email. Yours sincerely, Anja Karlstaedt