ERROR: operator does not exist: integer !=- integer

Поиск
Список
Период
Сортировка
От William ZHANG
Тема ERROR: operator does not exist: integer !=- integer
Дата
Msg-id esdf74$6rn$1@news.hub.org
обсуждение исходный текст
Ответы Re: ERROR: operator does not exist: integer !=- integer  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Here is the steps to reproduce it in CVS HEAD:

$ uname -a
Linux os-server 2.6.9-11.19AX #1 Fri Aug 5 05:12:07 EDT 2005 i686 i686 i386 
GNU/Linux

$ ./postgres --single -D $HOME/pgsql/data postgres

PostgreSQL stand-alone backend 8.3devel
backend> show server_version;        1: server_version      (typeid = 25, len = -1, typmod = -1, byval = 
f)       ----        1: server_version = "8.3devel" (typeid = 25, len = -1, typmod = -1, 
byval = f)       ----
backend> select -1 != -1;        1: ?column?    (typeid = 16, len = 1, typmod = -1, byval = t)       ----        1:
?column?= "f"      (typeid = 16, len = 1, typmod = -1, byval = 
 
t)       ----
backend> select -1 !=-1;
ERROR:  operator does not exist: integer !=- integer at character 11
HINT:  No operator matches the given name and argument type(s). You might 
need to add explicit type casts.
STATEMENT:  select -1 !=-1;

A quick hack in scan.l :

*** src/backend/parser/scan.l.old       2007-03-04 11:39:56.831289992 +0800
--- src/backend/parser/scan.l   2007-03-04 11:40:04.142178568 +0800
***************
*** 605,610 ****
--- 605,617 ----                                       {                                               int
ic;

+                                               /* filter out operaters end 
with '=' */
+                                               if (yytext[nchars - 2] == 
'=')
+                                               {
+                                                       nchars--;
+                                                       continue;
+                                               }
+                                               for (ic = nchars-2; ic >= 0; 
ic--)                                               {                                                       if 
(strchr("~!@#^&|`?%", yytext[ic]))

Now the result is correct:

backend> select -1 !=-1;        1: ?column?    (typeid = 16, len = 1, typmod = -1, byval = t)       ----        1:
?column?= "f"      (typeid = 16, len = 1, typmod = -1, byval = 
 
t)       ----
--
Regards,
William ZHANG




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

Предыдущее
От: Ryan Cumming
Дата:
Сообщение: Trivial HugeTLB Benchmark
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: operator does not exist: integer !=- integer