Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

Deletion of table accidently

Hi,
I accidentally truncated a table in postgresql on staging environment. It had lot of data.
I needed it for testing. Although a small amount of data would also suffice.
But the online portal which generates the data is also down.
So i am kind of stuck.
how do i test. what approaches do you suggest to resolve this or to avoid such things to happen or some alternative plan.
Is it possible to recover table data in postgresql ?

Thanks
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Is it possible to recover table data in postgresql ?
if data was backup, then you can restore it back, else it could mean your data is lost.

what approaches do you suggest to resolve this or to avoid such things to happen or some alternative plan.
always make a backup. you may also set read only privilege for certain test users to avoid the risk of data lost.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Best to take ste5an's advice.

Build a test data generator... because... there's no real reason to backup a staging/dev database repeatedly, when the data will always be the same.

Also, anytime you must spin up another staging/dev environment, having a test data generator will likely simplify your spin up process.