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

From Bruce Momjian
Subject Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Date
Msg-id 20160801163820.GB28246@momjian.us
Whole thread Raw
In response to Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
On Thu, Jul 21, 2016 at 09:49:33AM -0400, Tom Lane wrote:
> 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 am hoping for a "novice" mode that issues warnings about possible
bugs, e.g. unintentionally-correlated subselect, and this could be part
of that.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_size_pretty, SHOW, and spaces
Next
From: Robert Haas
Date:
Subject: Re: pg_replication_origin_xact_reset() and its argument variables