If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > by mistake delete query executed and lost the data want to restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-11, 06:38
sat123stud sat123stud is offline
Registered User
 
Join Date: Nov 2011
Posts: 3
Red face by mistake delete query executed and lost the data want to restore

Hi all,

by mistake i executed delete query on live server(production server).
on live server a backup of the database is taken through the script to
run and update the backup on stand by database server.

I know if a get the .backup file i can resolve the issue to some extent.

I got the file too..but it is only a single backup file.Now the problem is how
can i restore a backup having multiple database on my pc where postsgres is
installed.
Do i need to make a blank database having the same name as on production server ?

if yes then what will be the next step to restore it

Thanks in advance to take me out of this...
Reply With Quote
  #2 (permalink)  
Old 11-17-11, 14:39
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
The backup file is text, correct?
search the file for the 'INSERT INTO yourtablename' statements, & copy/paste these lines into a new SQL file. Then, run the new SQL file with pgAdmin or PSQL
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On