Hm, SQL92 like <> for the 'not equal' operator and that parses OK:
test=# select count(*) from foo where c<>-1;
count
-------
3
(1 row)
It's probably better to use <> ... I can sort of imagine the parser getting confused in your case...
Don't know if this helps?
Allan.
Dave Cramer wrote:
> Hello,
>
> I get the following error
>
> pl=# select * from person where id !=-1;
> ERROR: Unable to identify an operator '!=-' for types 'int8' and 'int4'
> You will have to retype this query using an explicit cast
>
> pl=# select * from person where id =-1;
> id | name | last_update_time
> ----+------+------------------
> (0 rows)
>
> However this works fine
>
> pl=# select * from person where id != -1;
>
> This looks like a parser error, note the space added in the select that
> works ??
>
> Dave
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster