The clever way is called a transaction.
Before doing any data manipulation, start a transaction.
Then do your update statements;
Then if there was an error type:
This will revert you data back to the state it was in before the transaction.
If there wasn't an error and the data looks sound type:
and the updates will be saved.
-- Garrett Bladow
---- This is what you wrote me ----
:This is a truly novice question but here goes:
:Yesterday I was on the command line and issued an UPDATE command. Right after I hit the ENTER key I realized that I forgot to put the WHERE clause in... so... every entry in the table got the update. Ooops. Since I hadn't updated this particular table in a while I just dropped it and put it back in from a backup.
:My question is... is there a clever way to undo or rollback a mistake you make at the 'psql' prompt?
In response to
pgsql-novice by date
|Next:||From: Ludwig Lim||Date: 2002-12-10 17:09:47|
|Subject: Re: How many connections can a Postgress database support...|
|Previous:||From: Steven Ames||Date: 2002-12-10 16:39:07|
|Subject: Undoing a typo?|