Search Postgresql Archives

space required before negative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux