Re: Unable to recover tables - Mailing list pgsql-novice

From Tom Lane
Subject Re: Unable to recover tables
Date
Msg-id 4997.1211759193@sss.pgh.pa.us
Whole thread Raw
In response to Unable to recover tables  ("G. J. Walsh" <gjwalsh@dscdirectionalservices.com>)
List pgsql-novice
"G. J. Walsh" <gjwalsh@dscdirectionalservices.com> writes:
> Thanks for your earlier reply, Tom.
> What I did was:
> Stop the server: service postgresql stop
> Remove the directory tree completely: rm -rf /var/lib/pgsql
> Restore the full tree:
> /bin/cp -r /bup/previous/var/lib/pgsql /var/lib/pgsql
> Ensure postgres owns all:
> chown postgres:postgres -R /var/lib/pgsql
> Restart the server: service postgresql restart

> At this point I can once again access the original data base
> and \l shows it correctly, but \d shows no relations.

Do you see any rows at all in pg_class in that database?

Also, where did /bup/previous/var/lib/pgsql come from?  If this was
a filesystem-level backup that was taken while the postmaster was
running, you may have consistency problems in it.

            regards, tom lane

pgsql-novice by date:

Previous
From: Emil Obermayr
Date:
Subject: Re: socket versus 127.0.0.1
Next
From: "Josep Sànchez Mesegué"
Date:
Subject: Cron and shell script as user postgres to run sql command