Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Дата
Msg-id CA+TgmoaXxJ+6gP_YZsr+gPt_ZLgbxYaBqA3hLBJWewNZfs62ng@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (David Fetter <david@fetter.org>)
Ответы Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (David Fetter <david@fetter.org>)
Список pgsql-hackers
On Thu, Jul 21, 2016 at 12:39 PM, David Fetter <david@fetter.org> wrote:
> On Thu, Jul 21, 2016 at 06:20:37PM +0300, Teodor Sigaev wrote:
>> > Please find attached a patch which makes it possible to disallow
>> > UPDATEs and DELETEs which lack a WHERE clause.  As this changes query
>> > behavior, I've made the new GUCs PGC_SUSET.
>> >
>> > What say?
>>
>> DELETE FROM tbl WHERE true; ?
>
> I specifically left this possible so the feature when turned on allows
> people to do updates with an always-true qualifier if that's what they
> actually mean to do.
>
> In case it wasn't clear, unqualified updates and deletes are permitted
> by default.  This patch allows people to set it so they're disallowed.

I join with others in thinking it's a reasonable contrib module.  In
fact, I already wrote it for my 2015 PGCon tutorial.  Well, the
"delete" part, anyway.

https://github.com/robertmhaas/introduction-to-postgresql-hacking/compare/master...robertmhaas:delete_needs_where

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: fixes for the Danish locale
Следующее
От: David Fetter
Дата:
Сообщение: Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE