Thread: Postgres

Postgres

From
Guru Prasad
Date:
Hi to list,

I had my database installed in my Slackware 7.0 (kernel 2.2.6). I was
using postgres 7.1 version. Now the database got corrupted. I had no clue
how it got corrupted. Basically, i did found that the data of various
users existing (in /usr/local/pgsql/data directory). But there were no
data existing in the following system catalogs.

pg_database. (except template0 & template1)
pg_shadow.   (except postgres user. Previously 15 users were there.)
pg_tables.   (Not showing any user created tables. Only system tables
get displayed).

But the data structure of individual tables exist somewhere. Suppose if i
do 'select * from tablename' then field names gets displayed but says 'no
rows'. At the same time, i am unable to get the structure through
\d tablename. 

Is it possible to recover the data in any way. I am having a old dump of
data which i can use to reinstall but i wanted to know how it happened in
the first place. Atleast, i can take some steps so that it doesn't happen
again.   

Could some one there help me out to recover the data.
Any help would be appreciated.

Regards,
Guru Prasad




Re: Postgres

From
Tom Lane
Date:
Guru Prasad <pnguruji@yahoo.com> writes:
> using postgres 7.1 version. Now the database got corrupted. I had no clue
> how it got corrupted. Basically, i did found that the data of various
> users existing (in /usr/local/pgsql/data directory). But there were no
> data existing in the following system catalogs.

> pg_database. (except template0 & template1)
> pg_shadow.   (except postgres user. Previously 15 users were there.)
> pg_tables.   (Not showing any user created tables. Only system tables
> get displayed).

> But the data structure of individual tables exist somewhere. Suppose if i
> do 'select * from tablename' then field names gets displayed but says 'no
> rows'. At the same time, i am unable to get the structure through
> \d tablename. 

If there's no entry for your database in pg_database, how were you able
to connect to do a 'select * from tablename'?

I'd like to see exactly what you did and exactly what results you got,
not your interpretations about whether there's data in tables or not.
Whatever's going on here is probably more subtle than that.
        regards, tom lane