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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: 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 07:49:11
Message-ID: CAA4eK1JMWsq5J8snZwjgEoQerNkuJ8GKfh7=NCuXTyUXDpzevw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 21, 2016 at 10:27 AM, David Fetter <david(at)fetter(dot)org> 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?
>

The use case for this functionality that comes to mind is to avoid
deleting/updating all the data, if user has accidentally missed the
WHERE clause. Do you have other use case for this functionality?
With this functionality, if user needs to actually delete or update
all the rows, then he has to artificially add where clause which seems
slightly inconvenient, but may be such cases are less.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2016-07-21 08:19:50 Re: [BUG] pg_basebackup from disconnected standby fails
Previous Message Etsuro Fujita 2016-07-21 07:30:46 Re: Oddity in handling of cached plans for FDW queries