query parsing bug? - Mailing list pgsql-general

From Eric Ridge
Subject query parsing bug?
Date
Msg-id D3ADE25911614840BC69C72E3171E4ED02812E@tcdiexch.tcdi.com
Whole thread Raw
Responses Re: query parsing bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
known behavior or bug?

  fr=# select count(*) from foo where foo_id!=-1;
  ERROR:  Unable to identify an operator '!=-' for types 'int4' and
'int4'
          You will have to retype this query using an explicit cast

  fr=# select count(*) from foo where foo_id!= -1;
  ...
  (1 row)


Notice the space (or lack thereof) between != and -1.  It only seems to
happen with != and a negative number.


  fr=# select count(*) from foo where foo_id=-1;
  ...
  (1 row)

  fr=# select count(*) from foo where foo_id!=1;
  ...
  (1 row)


This is with 7.1.3, via psql.  I haven't tried the query via another
interface (ie, JDBC).

eric

ps, wonder if I should be using <> instead of !=

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Got error on CREATE TABLE AS (+Bug?)
Next
From: "Andy Samuel"
Date:
Subject: Re: My new job