Re: Restoring databases using only data/ dir

From: "Charles H(dot) Woloszynski" <chw(at)clearmetrix(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Afra <aa4(at)cse(dot)buffalo(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Restoring databases using only data/ dir
Date: 2002-10-03 22:12:53
Message-ID: 3D9CC0E5.5060800@clearmetrix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Was the backup of the directory done with the postgresql server running
or stopped? I am going to guess that the server was running and that
the disk image was changing as the backup was made...

Tom Lane wrote:

>Afra <aa4(at)cse(dot)buffalo(dot)edu> writes:
>
>
>>Now, the old server was running postgres 7.1. So I installed the same
>>version in house and moved over the data/ directory from the backup tar
>>file to the newly build data directory:
>>
>>
>
>
>
>># mv backup/pgsql/data/global /usr/local/psql/data/
>># mv backup/pgsql/data/base /usr/local/psql/data/
>># mv backup/pgsql/data/pg_xlog /usr/local/psql/data
>>
>>
>
>Okay, this should have worked given that both machines were the same
>architecture --- you could possibly have got burnt by endianness or
>alignment issues otherwise.
>
>
>
>>Postgres starts up fine after the move, but then I cannot actually
>>retrieve any databases:
>>$ pg_dump wdcx > wdcx
>>pg_dump: couldn't find the pg_database entry.
>>There is no entry in the 'pg_database' table for this database.
>>
>>
>
>
>
>>Odd thing is, the database is in there and Postgres knows it:
>>$ createdb wdcx
>>ERROR: CREATE DATABASE: database "wdcx" already exists
>>createdb: database creation failed
>>
>>
>
>That is mighty suggestive. I'm thinking that the indexes on pg_database
>are corrupt. Are you able to connect to template1 and do "select * from
>pg_database"? If so, what do you see? If not, what happens exactly?
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>

--

Charles H. Woloszynski

ClearMetrix, Inc.
115 Research Drive
Bethlehem, PA 18015

tel: 610-419-2210 x400
fax: 240-371-3256
web: www.clearmetrix.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-10-03 22:15:59 Re: [SQL] [GENERAL] CURRENT_TIMESTAMP
Previous Message Andrew Sullivan 2002-10-03 22:03:19 Re: [SQL] [GENERAL] CURRENT_TIMESTAMP