From: Alex J. Avriette <avriettea@speakeasy.net>
To: pgsql-admin@postgresql.org
Subject: Re: URGENT: undoing a mistake
Date: Thu, 31 Oct 2002 10:26:26 -0500
Message-ID: <GamcnfQEzq8-1lygXTWcog@speakeasy.net> (raw)
In-Reply-To: <Pine.LNX.4.21.0210301550570.690-100000@perrin.socsci.unc.edu>
References: <Pine.LNX.4.21.0210301550570.690-100000@perrin.socsci.unc.edu>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: avriettea@speakeasy.net
Subject: Re: URGENT: undoing a mistake
In-Reply-To: <GamcnfQEzq8-1lygXTWcog@speakeasy.net>
References: <Pine.LNX.4.21.0210301550570.690-100000@perrin.socsci.unc.edu> <GamcnfQEzq8-1lygXTWcog@speakeasy.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox