On 25 June 2018 at 21:33, David G. Johnston <david.g.johns...@gmail.com> wrote:
> On Mon, Jun 25, 2018 at 6:17 PM, Yotsunaga, Naoki < > yotsunaga.na...@jp.fujitsu.com> wrote: > >> >> So what do you think about it? Do you think is it useful? >> > > I'd rather spend effort making the initial execution of said commands less > likely. Something like: > > TRUNCATE table YES_I_REALLY_WANT_TO_DO_THIS; > 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.