Обсуждение: How to undo an update to a table?

Поиск
Список
Период
Сортировка

How to undo an update to a table?

От
"Wang, Mary Y"
Дата:

Hi All,

 

I updated certain rows of a table and made a mistake.  Is there any way that I can roll back to the “previous” state of a table?  We do nightly incremental backups and weekly full backups.

 

I’m running on Postgres 8.4.11.

 

Mary

Re: How to undo an update to a table?

От
Jorge Torralba
Дата:
Too late for a rollback ?

If you are doing incremental the only thing I can think of now is restoring your cluster to a different environment to a point in time, then copy table content and repopulate or update the table in question. Sounds like a lot of work but doable.


On Tue, Apr 22, 2014 at 1:08 PM, Wang, Mary Y <mary.y.wang@boeing.com> wrote:

Hi All,

 

I updated certain rows of a table and made a mistake.  Is there any way that I can roll back to the “previous” state of a table?  We do nightly incremental backups and weekly full backups.

 

I’m running on Postgres 8.4.11.

 

Mary




--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential information. If you are not the intended recipient, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this email in error and delete the copy you received. Thank You.

Re: How to undo an update to a table?

От
Payal Singh
Дата:
what kind of backups are you taking? If you have dump backups, you can restore the single table to a different instance of with a different table name, and then switch the new and old tables. Although, you would be lucky if this solution works for you, since the table might have dependencies which might make it difficult to do this. 

Another thing you can do to ensure faster recovery is :

1. restore the backup to a new instance. This should be from a backup before the update
2. Get the changed rows
3. update these rows in the actual table. 

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253


On Tue, Apr 22, 2014 at 4:08 PM, Wang, Mary Y <mary.y.wang@boeing.com> wrote:

Hi All,

 

I updated certain rows of a table and made a mistake.  Is there any way that I can roll back to the “previous” state of a table?  We do nightly incremental backups and weekly full backups.

 

I’m running on Postgres 8.4.11.

 

Mary