According to postgresql manual != means the same as <>. In reality, it doesn't seems to be the case:
psql=> select 1 where 1!=-1;
ERROR: operator does not exist: integer !=- integer
LINE 1: select 1 where 1!=-1;
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
psql=> select 1 where 1<>-1;
?column?
----------
1
(1 row)
Is this a bug or this is an expected behavior that wasn't covered by the manual?
You need to write a space so that postgres knows, that it's a != operator and not !=-:
select 1 != -1;
Or you can put it in parentheses:
select 1!=(-1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With