From: Mark <mark@zserve.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Case Insensitive Queries
Date: 30 May 2001 11:47:41 -0600
Message-ID: <200105301839.f4UIdVW17478@mail.ldssingles.com> (raw)
In-Reply-To: <Pine.BSF.4.21.0105301111510.6551-100000@megazone23.bigpanda.com>
On 30 May 2001 11:16:35 -0700, Stephan Szabo wrote:
> On Wed, 30 May 2001, Tom Lane wrote:
>
> > Mark <mark@zserve.com> 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?
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mark@zserve.com, sszabo@megazone23.bigpanda.com, tgl@sss.pgh.pa.us
Subject: Re: Case Insensitive Queries
In-Reply-To: <200105301839.f4UIdVW17478@mail.ldssingles.com>
* 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