Recently I came across a bug in code, equivalent to this snippet:
create table testing(num int, dt date, istrue boolean); insert into testing values (1, '2018-01-01', True); UPDATE testing SET num = 2, istrue = null AND dt = '2018-01-01';
The UPDATE statement should have actually been:
UPDATE testing SET num = 2, istrue = null WHERE dt = '2018-01-01';
Yet postgresql happily accepted the UPDATE as valid and it evaluated the code:
null AND dt = '2018-01-01'
after the second equal sign as a boolean and therefore updated data based on bad logic.
I have tried this in other SQL flavors and it is not allowed, they want a WHERE.
I'm not a postgres person but it does seem like a very odd syntax quirk, or is it a bug?