By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

recovering fields in tables

P: 5
Hello,
i deleted few fields in a PostGreSql table. now i want recover them. how can i get them.
...das
May 8 '07 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 534
You can add these fields back to the table with the ALTER TABLE command.
But if you want to restore the values on these fileds your only hope is restoring the whole table from the backup, if you have one.
May 8 '07 #2

P: 5
You can add these fields back to the table with the ALTER TABLE command.
But if you want to restore the values on these fileds your only hope is restoring the whole table from the backup, if you have one.
Thanq Sir,

Yes we have the backup. can guide in detail with syntaxes please.
...Das
May 9 '07 #3

Expert 100+
P: 534
I cannot help you with syntax because there's more than one way to backup the database and you did not tell anything about which backup method you used.

Look at backup and restore man page, you may find everything you need there.

If you don't find the answer tell us the Operating System you're running on and how the backup was created, so we could help you here.
May 9 '07 #4

P: 5
Dear Sir,
Thank you for ur replies. by your link(Bakup and restore) we could get the database from past 10 days backup. but now i need to replace only the altered table, but not the entire database. we tried using exoport and import using Ms excell file. but there some errors are coming. like excess/redundant data or 0/null values.
Please help me how can i shift / replace a table from one database to another database.
Thankyou and Regards,
..das
May 10 '07 #5

Expert 100+
P: 534
You still did not tell anything about how your backup was created.
If you have an ASCII dump you can simply edit the backup file and take out everything you don't need, keeping only commands and data related to your table.
You may need to add a command to either drop/recreate this table or just truncate it.

If you have any dependencies (other tables with foreign keys pointing to this table, views, triggers, rules, etc) you may need to do some extra work.
May 10 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.