Re: Casting Integer to Boolean in assignment - Mailing list pgsql-general

From Geoff Winkless
Subject Re: Casting Integer to Boolean in assignment
Date
Msg-id CAEzk6feizMYvzRORT+ct-vycBBEhd2zbajZGVDNUxtzFdFM-bw@mail.gmail.com
Whole thread Raw
In response to Re: Casting Integer to Boolean in assignment  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Casting Integer to Boolean in assignment
List pgsql-general
On Thu, 24 Jan 2019 at 15:40, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> delete from delete_test where
>
> and then forget the 'field =' part. Though my more common mistake along
> that line is:
>
> delete from delete_test;
>
> At any rate, if it can be done it will be done.

If you follow that logic, then having a single boolean test at all
should be invalid.

CREATE TABLE mytest (myval char (1));
INSERT INTO mytest VALUES ('a'),('b'),('c'),('s'),('t');
DELETE FROM mytest WHERE 't';
SELECT * FROM mytest;
 myval
-------
(0 rows)

Geoff


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Casting Integer to Boolean in assignment
Next
From: bhargav kamineni
Date:
Subject: Re: log_min_duration_statement