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

From: David Fetter <david(at)fetter(dot)org>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: David Fetter <david(at)fetter(dot)org>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PoC: Make it possible to disallow WHERE-less UPDATE and DELETE
Date: 2016-07-21 16:39:08
Message-ID: 20160721163908.GA22284@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-07-21 16:42:33 Re: Regression tests vs existing users in an installation
Previous Message Robert Haas 2016-07-21 16:26:35 Re: Regression tests vs existing users in an installation