Re: the operator "=" does not work for some SQL queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: harald(dot)bartel(at)prozentor(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: the operator "=" does not work for some SQL queries
Date: 2001-04-20 20:27:43
Message-ID: 28085.987798463@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:
> For some SQL queries (for an example see below) the operator "=" on text does not work, that is, no rows are returned, although some should be returned.In PostgreSQL 7.0.3 I avoided this problem by using
> the LIKE operator instead of the "=" operator.In PostgreSQL 7.1 this
> trick does not work anymore. But I found another way to avoid the problem by using SUBSTR. For example I used substr(text1,1,8)=substr(text2,1,8) instead of text1=text2 or
> text1 like text2, where 8 is the length of both texts.

Perhaps you are failing to consider trailing blanks in one or both input
values?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2001-04-20 21:33:43 Re: pg_ctl restart bug
Previous Message Tom Lane 2001-04-20 20:25:09 Re: pg_ctl restart bug