Search Postgresql Archives

Re: doesn't recognize "!=-" (not equal to a negative value)

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

 



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


[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