known behavior or bug?
fr=# select count(*) from foo where foo_id!=-1;
ERROR: Unable to identify an operator '!=-' for types 'int4' and
'int4'
You will have to retype this query using an explicit cast
fr=# select count(*) from foo where foo_id!= -1;
...
(1 row)
Notice the space (or lack thereof) between != and -1. It only seems to
happen with != and a negative number.
fr=# select count(*) from foo where foo_id=-1;
...
(1 row)
fr=# select count(*) from foo where foo_id!=1;
...
(1 row)
This is with 7.1.3, via psql. I haven't tried the query via another
interface (ie, JDBC).
eric
ps, wonder if I should be using <> instead of !=
"Eric Ridge" <ebr@tcdi.com> writes: > ps, wonder if I should be using <> instead of != Yup. See the fine print at http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/sql-syntax.html#SQL-SYNTAX-OPERATORS regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера