Hi
I was surprised to find that whitespace is required between the !=
operator and a negative sign, otherwise postgres believes that I'm
intending !=- as an operator (I get "operator does not exist: integer
!=- integer").
This isn't the case with <>-x.
Is this intentional? I couldn't find reference to it in the
documentation (certainly not in
http://www.postgresql.org/docs/9.5/static/functions-comparison.html).
db=# SELECT 'yes' WHERE 1!=-1;
ERROR: operator does not exist: integer !=- integer
LINE 1: SELECT 'yes' WHERE 1!=-1;
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
Time: 0.608 ms
db=# SELECT 'yes' WHERE 1<>-1;
?column?
----------
yes
(1 row)
I get this with fieldnames too, so it's not just a parsing-literal problem...
This is on 9.5, also on 9.5.1.
Geoff