Postgresql revert back database value
-
16-10-2019 - |
Question
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 ?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange