Re: URGENT: undoing a mistake - Mailing list pgsql-admin

From Alex J. Avriette
Subject Re: URGENT: undoing a mistake
Date
Msg-id GamcnfQEzq8-1lygXTWcog@speakeasy.net
Whole thread Raw
In response to URGENT: undoing a mistake  (Andrew Perrin <clists@perrin.socsci.unc.edu>)
List pgsql-admin
> I just made a mistake that could be quite costly: I did this:
>
> update writer_survey set partid='W41308' where survid in (select survid
> from participants where partid='W41291' limit 1);
>
> when I should have done this:
>
> update writer_survey set partid='W41308' where survid in (select survid
> from writer_survey where partid='W41291' limit 1);



Ouch. First off, Postgres has transactioning. If you use BEGIN ...
[ROLLBACK|COMMIT] you can avoid things like that. (the Perl DBI driver
will allow you to do this, check the perldoc page for DBI). As a last
resort, you can probably restore from the dump of the table/database you
make nightly (riiiight?).

Alex


pgsql-admin by date:

Previous
From: John Sequeira
Date:
Subject: HA for high insert volume
Next
From: "scott.marlowe"
Date:
Subject: Re: [GENERAL] my.cnf to postgresql.conf Conversion