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

From Tom Lane
Subject Re: doesn't recognize "!=-" (not equal to a negative value)
Date
Msg-id 5758.1152650047@sss.pgh.pa.us
Whole thread Raw
In response to doesn't recognize "!=-" (not equal to a negative value)  (Paul Tilles <Paul.Tilles@noaa.gov>)
List pgsql-general
Paul Tilles <Paul.Tilles@noaa.gov> writes:
> UPDATE tablename SET value = 0.0 where value!=-9.4;
> 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.

This is not a bug, this is a feature.

Put a space between, or else use the SQL-standard spelling of not-equals,
ie <>

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

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgsql vs mysql
Next
From: Tom Lane
Date:
Subject: Re: pgsql vs mysql