Re: Please help (backup) - Mailing list pgsql-admin

From Phillip Smith
Subject Re: Please help (backup)
Date
Msg-id 024701c8147c$55cc9430$9b0014ac@wbaus090
Whole thread Raw
In response to Please help (backup)  (Anibal David Acosta <aa@personal.net.py>)
Responses Re: Please help (backup)
List pgsql-admin

(Please reply to the list so everyone can keep track of the thread)

 

You’ll need to look at the table definitions to work out what the data should look like, and if it doesn’t look like that – then it’s probably part of the corrupt data…

 

 

-----Original Message-----
From: Anibal David Acosta [mailto:aa@personal.net.py]
Sent: Monday, 22 October 2007 15:33
To: Phillip Smith
Subject: Re: [ADMIN] Please help (backup)

 

I open with word pad & notepad, but table, functions and other object declarations looks like "plain text" but the DATA nope.

This is the beginnig of something that looks as DB object
---------------------------------------------------------------------
ALTER TABLE ONLY threads
    ADD CONSTRAINT threads_fk1 FOREIGN KEY (forum_id) REFERENCES forums(id) ON DELETE RESTRICT;
 =   ALTER TABLE ONLY public.threads DROP CONSTRAINT threads_fk1;
       public       postgres    false


   1488
   1869
   1464     
---------------------------------------------------------------------



This is the beginnig of something that looks as DB object
---------------------------------------------------------------------

 xœeYÝzÚ¸½Þ}
Ï͹˜ïk¶1†»!
¤¤$á MÛ3gÊ'Œ Ùbd;=É74Wç]æQæ
Î’Im·?!^–-ikk­µE—†CæjgJš½‰ÜÕ…È•VÂÒÅ›Ð]_ÊBZ
---------------------------------------------------------------------


BTW, I used the "PGAdmin" application to make the backup, I don't have any BLOB column, just normal data type (integer, varchar, datetime)


As you can see, the "data" section is not human readable, so I cant  modify it.


Thanks for your time Phillip, I hope  to find a solution.

regards.

Anibal

Phillip Smith escribió:
The dumped file is just a plain-text file (Depending on the data types
within your database)
 
You should be able to open the backup you made with pg_dump in your
favourite editor such as vi and search through for the dodgy data. Clear out
the bad stuff, write it back to disk and you should be good to go.
 
Obviously this won't "save" the damaged portion of the data, and it may have
unpredictable effects when you take in to account any foreign keys etc you
may have in the database that depends on this data.
 
Cheers,
~p
 
  
-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-
owner@postgresql.org] On Behalf Of Anibal David Acosta
Sent: Monday, 22 October 2007 11:16
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Please help (backup)
 
I have a backup done with "pg_dump" utility.
 
For some reason the backup file has 8 phisical bad sectors (17 KB of data)
 
Now when I try to restore the backup all tables are created successfully
and data of almost all tables restores successfully too, but one table
(the most important) appear empty.
 
When I do a pg_restore <backup_file> its show all sql instructions and
data until arrive to the "damaged sector" and throws a "out of memory"
exception.
 
I want to know if is possible to fix the backup file removing the blocks
in the "bad sectors" in order to restore all other information.
 
something like file dump surgery :)
 
Thanks!
 
Anibal
 
 
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
 
               http://archives.postgresql.org
    
 
 
THINK BEFORE YOU PRINT - Save paper if you don't really need to print this
 
*******************Confidentiality and Privilege Notice*******************
 
The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.
 
Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.
 
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly
 
 
  

THINK BEFORE YOU PRINT - Save paper if you don't really need to print this e-mail.

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments

pgsql-admin by date:

Previous
From: "Phillip Smith"
Date:
Subject: Re: Please help (backup)
Next
From: cho
Date:
Subject: Re: Cluster/Replication