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

Поиск
Список
Период
Сортировка
От Eric B. Ridge
Тема Re: doesn't recognize "!=-" (not equal to a negative value)
Дата
Msg-id F9A2B1CB-3FC1-43E8-B171-44F03B156580@tcdi.com
обсуждение исходный текст
Ответ на doesn't recognize "!=-" (not equal to a negative value)  (Paul Tilles <Paul.Tilles@noaa.gov>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Carl M. Nasal II"
Дата:
Сообщение: PostgreSQL Server Crash using plPHP or PL/Perl
Следующее
От: Douglas McNaught
Дата:
Сообщение: Re: troubleshooting 8.1.2