Re: Disruptive corruption of data during an update
От | Binand Sethumadhavan |
---|---|
Тема | Re: Disruptive corruption of data during an update |
Дата | |
Msg-id | CAFBJCCa9e0XJhcJG3u7WK5thS4XMejTSBEq52CCgAuSOLcJ2uQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Disruptive corruption of data during an update (Ennio-Sr <nasr.laili@tin.it>) |
Ответы |
Re: Disruptive corruption of data during an update
Re: Disruptive corruption of data during an update |
Список | pgsql-novice |
On 29 March 2012 16:47, Ennio-Sr <nasr.laili@tin.it> wrote: > -------- > mydb=> update bibl set argomento='curatori', autore='DELLA VOLPE Galvano \ > (con due capitoli aggiunti e note di) where n_prog=3285; > mydb'> '; > > UPDATE 12845 > mydb=> > -------- > > Having an adequate back-up I think I'll be able to recover the data, but > can someone explain what the hell happened? Because of the single quote being at the wrong place, your query was processed as though not having a where clause at all, and the ENTIRE table got updated with the text: DELLA VOLPE Galvano \ (con due capitoli aggiunti e note di) where n_prog=3285; in the autore field (and similarly in the argomento field). What I typically do is to attach "where 1 = 0" to inhibit a query from making any changes, if I find an error in a multiline query and do not want to Control-C out of psql. Binand
В списке pgsql-novice по дате отправления: