Re: URGENT: undoing a mistake

From: "Alex J(dot) Avriette" <avriettea(at)speakeasy(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: URGENT: undoing a mistake
Date: 2002-10-31 15:26:26
Message-ID: GamcnfQEzq8-1lygXTWcog@speakeasy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Marc Mitchell 2002-10-31 15:54:12 Re: To Blob or Not to Blob? THAT is the question.
Previous Message Gareth Kirwan 2002-10-31 15:13:57 Re: array character types