RE: Recovering data from binary files?

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Paulo Jan" <admin(at)digital(dot)ddnet(dot)es>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>, <pgsql-general(at)postgreSQL(dot)org>, <fvilches(at)mail(dot)ddnet(dot)es>
Subject: RE: Recovering data from binary files?
Date: 2000-05-08 15:47:38
Message-ID: NDBBIJLOILGIKBGDINDFMENOCEAA.Inoue@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> -----Original Message-----
> From: pgsql-general-owner(at)hub(dot)org
> [mailto:pgsql-general-owner(at)hub(dot)org]On Behalf Of Paulo Jan
> Sent: Tuesday, May 09, 2000 12:00 AM
> To: pgsql-general(at)postgresql(dot)org
> Cc: fvilches(at)mail(dot)ddnet(dot)es
> Subject: [GENERAL] Recovering data from binary files?
>
>
> Hi all:
>
> Well, after my earlier post regarding pg_operator being corrupted, I
> received a mail from one of the Postgres developers (I think) talking
> about one of the system indexes (pg_attribute_relid_attnum_index) being
> corrupted, so I gave it a try and copied said file from the template1
> database to the one I have to recover... and now it gives me another
> error: "cannot find attribute 1 of relation pg_user". Like before, I
> can't even do a \d to see the existing tables in the database, much less
> insert/update anything in the pg_* tables to fix it, and after
> struggling the whole morning with it, I have pretty much given up on
> that path.
> I am trying now to:
>
> 1) Re-create the database in another machine.
> 2) Copy the binary files that contain the tables (minus the
> pg_* ones)
> to the other server, in the place where the new database has been
> created ($PGDATA/base/$dbname).

Oh it seems almost same as pg_upgrade.
However you should probably copy pg_log and pg_variable to
$PGDATA as pg_upgrade does.
In addtion if postmaster is running,you should shutdown before
processing 2).

Regards.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

> 3) Try to access the tables from there using psql.
>
> The problem now is that, although I can view the tables
> correctly, they
> all come up as empty. All the SELECTs I try on them return nothing. And
> the strange thing is that pg_class.reltuples says that said table has
> 5478 tuples, which is correct.
> Any other ideas? Is there any other way to access the
> binary files and
> extract the information in them to text? My manager is starting to talk
> about migrating to SQL Server, and frankly, at this point I'm finding
> less and less arguments to counter him...
>
>
> Paulo Jan.
> DDnet.
>

In response to

Responses

  • Miracle at 2000-05-08 17:05:09 from Paulo Jan

Browse pgsql-general by date

  From Date Subject
Next Message Benjamin Adida 2000-05-08 15:59:10 Re: So we're in agreement....
Previous Message Philip Warner 2000-05-08 15:38:40 Re: So we're in agreement....

Browse pgsql-hackers by date

  From Date Subject
Next Message Trond Eivind=?iso-8859-1?q?_Glomsr=F8d?= 2000-05-08 15:47:46 Re: Re: Ready to release?
Previous Message Bruce Momjian 2000-05-08 15:41:25 Re: Re: Ready to release?