On Jul 11, 2006, at 1:11 PM, Paul Tilles wrote:
ERROR:  operator does not exist: smallint !=- integer
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.

I'm pretty sure the SQL-standard spelling of "not equals" is "<>". Postgres supporting "!=" is just a nicety. In fact, the documentation for comparison operators states that "The != operator is converted to <> in the parser stage.". http://www.postgresql.org/ docs/8.1/static/functions-comparison.html

Alternatively, you can put a space before the minus sign:

        UPDATE tablename SET value = 0.0 where value!= -9.4;

I think the reason for what seems like a mis-parsing is due to Postgres' extensible operator system. Postgres can't disambiguate what you mean by "!=-" because those three characters are also valid in custom operators. See http://www.postgresql.org/docs/8.1/static/ sql-createoperator.html for the complete list of valid characters.

eric

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to