Skip site navigation (1) Skip section navigation (2)

Re: Disruptive corruption of data during an update

From: ennio <eiannucci(at)tin(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Disruptive corruption of data during an update
Date: 2012-03-29 14:04:26
Message-ID: 20120329140426.GA28601@deby.ei.hnet (view raw or flat)
Thread:
Lists: pgsql-novice
* Binand Sethumadhavan <binand(at)gmx(dot)net> [290312, 17:03]:
> 
> 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:
> [...] 
> in the autore field (and similarly in the argomento field).
> 
Oh yes, I did realize that, but too late ;(

> 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

Thanks for your suggestion, regards,
     ennio


-- 
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.    \\?//
 Fa' qualche cosa di cui non sei capace!"   (diceva Henry Miller) ]    (°|°)
 Ricevo solo messaggi Content-Type: plain/text (no html o multipart).   )=(
 !!! --> e-mail a mio nome via OE (M$) sono false  e infette <-- !!!

In response to

pgsql-novice by date

Next:From: Ennio-SrDate: 2012-03-29 16:00:13
Subject: Re: Disruptive corruption of data during an update
Previous:From: Steve TDate: 2012-03-29 12:40:55
Subject: Re: Disruptive corruption of data during an update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group