Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have postgresql database. My table name is tblvoippolicy. Now, problem is by mistake i have deleted some records from table. When I get the data file using following commands.

select * from pg_class where relname = 'tblvoippolicy' ; I get the following result

    relname    | relnamespace | reltype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relacl 
---------------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------
 tblvoippolicy |        17234 |  407227 |      100 |     0 |      407226 |             0 |        0 |         0 |             0 |             0 | t           | f           | r       |        8 |         0 |           0 |        0 |        0 |       0 | t          | t          | f           | f              | 

Now, when I look that data into data file of database using cat /var/pgsql/data/base/17230/407226. I get following result.

[root@manage upload]# cat /var/pgsql/data/base/17230/407226
ôu\"(Ô  Ÿà Ÿà¨žð8žàÔÈM ï¡test EC250
@%
ÿ10.106.1.228Q   ï–BEC200_Post_250      EC200
ú%
ú10.106.1.228?   ï”BBS_Service_Pre_250bs_service_1
@&
ú10.106.1.2286   ï’BEC200_Pre_500       EC200
@&
ô10.106.1.228+   ïBEC200_Pre_250       EC200
@&

I can not understand the described values and I want to revert back the records which I have deleted from table, how can I get back that records ?

share|improve this question
    
Have you got a recent backup of the database? –  Jack Douglas Feb 6 '12 at 14:50
    
does this link help?stackoverflow.com/questions/3305961/… –  swasheck Feb 6 '12 at 19:33
    
@JackDouglas I have not taken any backup. –  Bhavik Ambani Feb 7 '12 at 5:06
    
@swasheck The problem is I can not understand the data in the data file of postgresql database. –  Bhavik Ambani Feb 7 '12 at 5:07
1  
if you dont have any backups containing those records, you cant revert back them. –  sftsz Feb 8 '12 at 7:27

1 Answer 1

up vote 2 down vote accepted

See if this helps. I would take a backup right away because if vacuum cleans out the deleted row it's gone and you won't have any chance to recover it.

Recover Deleted Row

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.