Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Date
Msg-id 07ab32b2-6580-3476-92e8-838c8b00df84@2ndquadrant.fr
Whole thread Raw
In response to PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (David Fetter <david@fetter.org>)
Responses Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
List pgsql-hackers
On 21/07/16 06:57, David Fetter wrote:
> Folks,
> 
> 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?

I say I don't like this at all.

As mentioned elsewhere in the thread, you can just do WHERE true to get
around it, so why on Earth have it PGC_SUSET?

I would rather, if we need nannying at all, have a threshold of number
of rows affected.  So if your update or delete exceeds that threshold,
the query will be canceled.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why we lost Uber as a user
Next
From: Josh Berkus
Date:
Subject: Re: Why we lost Uber as a user