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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Дата
Msg-id CAB7nPqRDoOZ+a1xO9fmSg9zzHsaww85SONL9zuZQ+XAVNCwANg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On Sat, Oct 1, 2016 at 5:08 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> I guess you need something involving query_tree_walker or some other
> kind of recursive traversal if you want to find DELETE/UPDATE lurking
> in there.
>
> One option would be to document it as working for top level DELETE or
> UPDATE, and leave the recursive version as an improvement for a later
> patch.  That's the most interesting kind to catch because that's what
> people are most likely to type directly into a command line.

That would be a halfy-baked feature then, and the patch would finish
by being refactored anyway if we support more cases in the future,
because those will need a tree walker (think CTAS, INSERT SELECT,
using WITH queries that contain DMLs)... Personally I think that it
would be surprising if subqueries are not restrained. So I am -1 for
the patch as-is, and let's come up with the most generic approach.

Having more regression tests would be a good idea as well. I am
marking the patch as returned with feedback. This CF has normally
already ended.
-- 
Michael



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: COPY command with RLS bug
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench more operators & functions