Received: from mail.ldssingles.com (mail.ldssingles.org [63.226.117.101]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4UIdrE16487 for ; Wed, 30 May 2001 14:39:53 -0400 (EDT) (envelope-from mark@zserve.com) Received: from mark.ldssingles.com (mark.ldssingles.com [192.168.1.31]) by mail.ldssingles.com (8.11.2/8.11.2) with ESMTP id f4UIdVW17478; Wed, 30 May 2001 12:39:31 -0600 Message-Id: <200105301839.f4UIdVW17478@mail.ldssingles.com> Subject: Re: Case Insensitive Queries From: Mark To: Stephan Szabo Cc: Tom Lane , pgsql-sql@postgresql.org In-Reply-To: Content-Type: text/plain X-Mailer: Evolution (0.9 - Preview Release) Date: 30 May 2001 11:47:41 -0600 Mime-Version: 1.0 X-Archive-Number: 200105/341 X-Sequence-Number: 3182 On 30 May 2001 11:16:35 -0700, Stephan Szabo wrote: > On Wed, 30 May 2001, Tom Lane wrote: > > > Mark writes: > > > It appears that the behavior of a bpchar compare with a string literal > > > is not implicitly trimming the bpchar before the compare, which IMHO is > > > incorrect behavior. Is my opinion valid? > > > > regression=# create table foo (f1 char(20)); > > CREATE > > regression=# insert into foo values ('zz'); > > INSERT 800569 1 > > regression=# select * from foo; > > f1 > > ---------------------- > > zz > > (1 row) > > > > regression=# select * from foo where f1 = 'zz'; > > f1 > > ---------------------- > > zz > > (1 row) > > > > regression=# > > > > You'll need to be more specific about what you're unhappy about. > > Given the thread, I think the problem he's having is tied up in > upper and lower implicitly converting to text. > > select * from foo where upper(f1)='ZZ'; > gives no rows but if you put 18 spaces after the ZZ you get the > row. > > could I cast from text to something else?