Re: URGENT: undoing a mistake

Поиск
Список
Период
Сортировка
От Alex J. Avriette
Тема Re: URGENT: undoing a mistake
Дата
Msg-id GamcnfQEzq8-1lygXTWcog@speakeasy.net
обсуждение исходный текст
Ответ на URGENT: undoing a mistake  (Andrew Perrin <clists@perrin.socsci.unc.edu>)
Список 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 по дате отправления:

Предыдущее
От: John Sequeira
Дата:
Сообщение: HA for high insert volume
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: [GENERAL] my.cnf to postgresql.conf Conversion