From: Michael Paquier <michael@paquier.xyz>
To: Isaac Morland <isaac.morland@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Yotsunaga, Naoki <yotsunaga.naoki@jp.fujitsu.com>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Subject: Re: automatic restore point
Date: Tue, 26 Jun 2018 14:16:00 +0900
Message-ID: <20180626051600.GC31353@paquier.xyz> (raw)
In-Reply-To: <CAMsGm5cbv6BwqzsUHGVDUvn5yMePhyZBCfPhND88QAWv6MqwOA@mail.gmail.com>
References: <8E9126CB6CE2CD42962059AB0FBF7B0DBE3167@g01jpexmbkw23>
<CAKFQuwamx96qu6GAM8OuoM3DNEockiiiE=VOx1LV0_Hag5bOrQ@mail.gmail.com>
<CAMsGm5cbv6BwqzsUHGVDUvn5yMePhyZBCfPhND88QAWv6MqwOA@mail.gmail.com>
On Mon, Jun 25, 2018 at 11:01:06PM -0400, Isaac Morland wrote:
> I think an optional setting making DELETE and UPDATE without a WHERE clause
> illegal would be handy. Obviously this would have to be optional for
> backward compatibility. Perhaps even just a GUC setting, with the intent
> being that one would set it in .psqlrc so that omitting the WHERE clause at
> the command line would just be a syntax error. If one actually does need to
> affect the whole table one can just say WHERE TRUE. For applications, which
> presumably have their SQL queries tightly controlled and pre-written
> anyway, this would most likely not be particularly useful.
There was a patch doing exactly that which was discussed last year:
https://commitfest.postgresql.org/13/948/https://www.postgresql.org/message-id/20160721045746.GA25043@fetter.org
What was proposed was rather limiting though, see my messages on the
thread. Using a hook, that's simple enough to develop an extension
which does that.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, isaac.morland@gmail.com, david.g.johnston@gmail.com, yotsunaga.naoki@jp.fujitsu.com
Subject: Re: automatic restore point
In-Reply-To: <20180626051600.GC31353@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox