dbTalk Databases Forums  

Rollback won't work, any way correct a catastrophe?

comp.databases.postgresql comp.databases.postgresql


Discuss Rollback won't work, any way correct a catastrophe? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Laura I Kataja
 
Posts: n/a

Default Rollback won't work, any way correct a catastrophe? - 09-23-2007 , 02:00 AM






I gave an update command in a database and forgot to write the
where-condition.

Rollback?

"WARNING: ROLLBACK: no transaction in progress
ROLLBACK"

(over 1600 records overwritten).

Is there any way to get the data back?
(_part_ of it is in messy form in other tables)

That is an old potrgres, 7.3.4 (I should update both operating system
(Mandrake 9.2) and that.

Rollback is a basic operation from prehistoric age, that really was
a nasty surprise.

--

Freedom of speech, a righ not a privilege!
Laura Kataja
kisuli miau iki poäng fi
Kuvaelma: <http://www.helsinki.fi/~likataja/Kirjakauppa.html>

Reply With Quote
  #2  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Rollback won't work, any way correct a catastrophe? - 09-23-2007 , 03:08 AM






begin Laura I Kataja <likataja (AT) cc (DOT) helsinki.fi> wrote:
Quote:
I gave an update command in a database and forgot to write the
where-condition.

Rollback?

"WARNING: ROLLBACK: no transaction in progress
ROLLBACK"
You forgot two things: not only the WHERE condition, unfortunately the
BEGIN-Statement also.


Quote:
Rollback is a basic operation from prehistoric age, that really was
a nasty surprise.
ROLLBACK works only if you start a TRANSACTION before. You can enforce
this (in psql) with \set AUTOCOMMIT off, i have this in my ~/.psqlrc:

\set HISTFILE ~/.psql_history- BNAME
\set PROMPT1 '%/%R%x%# '
\set AUTOCOMMIT off
\set ON_ERROR_ROLLBACK on


I'm afraid, but i think, you have no chance to get back your data...



end
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°


Reply With Quote
  #3  
Old   
Laura I Kataja
 
Posts: n/a

Default Re: Rollback won't work, any way correct a catastrophe? - 09-23-2007 , 03:13 AM



In article <6hjhs4-5k4.ln1 (AT) news (DOT) a-kretschmer.de>, Andreas Kretschmer wrote:
Quote:
begin Laura I Kataja <likataja (AT) cc (DOT) helsinki.fi> wrote:
I gave an update command in a database and forgot to write the
where-condition.

Rollback?

"WARNING: ROLLBACK: no transaction in progress
ROLLBACK"

You forgot two things: not only the WHERE condition, unfortunately the
BEGIN-Statement also.


Rollback is a basic operation from prehistoric age, that really was
a nasty surprise.

ROLLBACK works only if you start a TRANSACTION before. You can enforce
this (in psql) with \set AUTOCOMMIT off, i have this in my ~/.psqlrc:

\set HISTFILE ~/.psql_history- BNAME
\set PROMPT1 '%/%R%x%# '
\set AUTOCOMMIT off
\set ON_ERROR_ROLLBACK on

I'm afraid, but i think, you have no chance to get back your data...
Oh, gosh... REALLY awful default. (If you think the autocommit is on,
and it isn't - what may happen? You're not supposed to use rollback, are
you? And at the worst rollback at wrong point might destroy your
session's work. Or if you plan to use rollback, you _know_ you must put
savepoints. The other way round - you may give a command that destroys
you work from several months...

I was thinking that there might be some other way to get back - the
commands are logged, but is there really no log for committed transactions
(e.g. possibility to return to a point of time?)

--

Freedom of speech, a right not a privilege!
Laura Kataja
kisuli miau iki poäng fi
Kuvaelma: <http://www.helsinki.fi/~likataja/Kirjakauppa.html>


Reply With Quote
  #4  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Rollback won't work, any way correct a catastrophe? - 10-01-2007 , 03:21 AM



Laura I Kataja <likataja (AT) cc (DOT) helsinki.fi> wrote:
Quote:
I gave an update command in a database and forgot to write the
where-condition.

Rollback?

"WARNING: ROLLBACK: no transaction in progress
ROLLBACK"

I was thinking that there might be some other way to get back - the
commands are logged, but is there really no log for committed transactions
(e.g. possibility to return to a point of time?)
This is moot, but IF you had a more recent version than 7.x, AND you
had enabled WAL archiving, AND you had made a backup at some point, there
would be a way: Point in Time Recovery.

If nothing else, maybe this serves as a good reason why to undergo the
pains of upgrading...

Yours,
Laurenz Albe


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.