Re: "DELETE FROM" protection

From: Yuji Shinozaki <ys2n(at)virginia(dot)edu>
To: Dave Ewart <Dave(dot)Ewart(at)cancer(dot)org(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: "DELETE FROM" protection
Date: 2004-02-20 13:27:56
Message-ID: Pine.LNX.4.44.0402200823180.21498-100000@atg2000.itc.virginia.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


I've gotten myself into the habit of always writing out a

SELECT ... FROM ... WHERE ...;

first, and then command-line editing it to

DELETE FROM ... WHERE ...;

Putting it in a transaction (BEGIN, COMMIT or ROLLBACK) is probably the
best practice.

yuji
----

On Fri, 20 Feb 2004, Dave Ewart wrote:

> On Friday, 20.02.2004 at 10:12 +0000, Matt Clark wrote:
>
> > > So now with pgsql, when I am typing "DELETE FROM...." until I get to
> > > the "WHERE" part of the statement, I get a little nervous because I
> > > know hitting Enter by mistake will wipe out that table. [...]
>
> How about typing the "WHERE" part of the statement first, then
> 'left-arrowing' back to the start of the statement and do "DELETE FROM
> ..." *last*?
>
> Dave.
> --
> Dave Ewart
> Dave(dot)Ewart(at)cancer(dot)org(dot)uk
> Computing Manager, Epidemiology Unit, Oxford
> Cancer Research UK
> PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

Yuji Shinozaki Computer Systems Senior Engineer
ys2n(at)virginia(dot)edu Advanced Technologies Group
(434)924-7171 Information Technology & Communication
http://www.people.virginia.edu/~ys2n University of Virginia

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2004-02-20 13:55:09 Re: ANALYZE crashes randomly
Previous Message www.mg.te.ua 2004-02-20 12:01:50 problems with regressive tests on rh8.0