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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Дата
Msg-id 7111.1469108973@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> 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?

-1.  This is an express violation of the SQL standard, and at least the
UPDATE case has reasonable use-cases.  Moreover, if your desire is to have
training wheels for SQL, there are any number of other well-known gotchas
that are just as dangerous, for example ye olde unintentionally-correlated
subselect:
https://www.postgresql.org/message-id/20160714135233.1410.92538%40wrigleys.postgresql.org

I wouldn't have any objection to an extension that enforces rules like
these, but I don't think it belongs in core.
        regards, tom lane



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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Unexpected memory usage for repeated inserts within plpgsql function
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE