Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA48152 for ; Wed, 24 May 2000 12:34:05 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id MAA07605; Wed, 24 May 2000 12:33:37 -0400 (EDT) To: Michael Ma cc: pgsql-sql Subject: Re: Unable to identify a right operator '>=' for type 'bpchar' In-reply-to: <392BF383.689FB14B@ficnet.net> References: <392BF383.689FB14B@ficnet.net> Comments: In-reply-to Michael Ma message dated "Wed, 24 May 2000 23:21:39 +0800" Date: Wed, 24 May 2000 12:33:37 -0400 Message-ID: <7602.959186017@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/118 Michael Ma writes: > While running the following SQL statement in postgresql-7.0-1 via > JDBC, > select a.cus_code, a.dlv_code, b.cus_abbr, a.dlv_abbr, > a.address, a.tel, a.fax, a.contact > from dlv_point a, customer b > where ((a.cus_code >= ? and a.cus_code <= ?) > or (b.cus_abbr >= ? and b.cus_abbr <= ?)) > and trim(b.cus_code) = trim(a.cus_code) > order by 1 ; > I got the following error message: > Unable to identify a right operator '>=' for type 'bpchar' > You may meed to add parentheses or an explicit cast. It looks to me like the parser is thinking that "a.cus_code >= ?" must represent application of a suffix operator '>=' followed by application of another suffix operator '?'. Which is indeed about the only way it could make any sense of the expression. I assume you were expecting something to get substituted for the '?' marks before the query is submitted, but it evidently didn't happen ... regards, tom lane