Re: Preventing DELETE and UPDATE without a WHERE clause?

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Preventing DELETE and UPDATE without a WHERE clause?
Дата
Msg-id
12104.1150425319@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Preventing DELETE and UPDATE without a WHERE clause? Chris Campbell <chris@bignerdranch.com>
Re: Preventing DELETE and UPDATE without a WHERE clause? Tom Lane <tgl@sss.pgh.pa.us>
Re: Preventing DELETE and UPDATE without a WHERE clause? "Mark Woodward" <pgsql@mohawksoft.com>
Re: Preventing DELETE and UPDATE without a WHERE clause? "Jaime Casanova" <systemguards@gmail.com>
Re: Preventing DELETE and UPDATE without a WHERE clause? "Mark Woodward" <pgsql@mohawksoft.com>
Re: Preventing DELETE and UPDATE without a WHERE clause? mark@mark.mielke.cc
Chris Campbell  writes:
> I heard an interesting feature request today: preventing the  
> execution of a DELETE or UPDATE query that does not have a WHERE clause.

These syntaxes are required by the SQL spec.  Furthermore, it's easy
to imagine far-more-probable cases in which the system wouldn't detect
that you'd made a mistake, eg
DELETE FROM tab WHERE key > 1

where you meant to type
DELETE FROM tab WHERE key > 10000000

I suggest counseling your client to learn how to use BEGIN/ROLLBACK.
This proposal strikes me as falling squarely within the rule about
"design a system that even a fool can use, and only a fool will want
to use it".
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Chris Campbell
Дата:
От: Toru SHIMOGAKI
Дата:
FAQ