From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Ma <mikema@ficnet.net>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Unable to identify a right operator '>=' for type 'bpchar'
Date: Wed, 24 May 2000 12:33:37 -0400
Message-ID: <7602.959186017@sss.pgh.pa.us> (raw)
In-Reply-To: <392BF383.689FB14B@ficnet.net>
References: <392BF383.689FB14B@ficnet.net>
Michael Ma <mikema@ficnet.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, mikema@ficnet.net
Subject: Re: Unable to identify a right operator '>=' for type 'bpchar'
In-Reply-To: <7602.959186017@sss.pgh.pa.us>
References: <392BF383.689FB14B@ficnet.net> <7602.959186017@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox