Skip site navigation (1) Skip section navigation (2)

Re: Case Insensitive Queries

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark <mark(at)zserve(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Case Insensitive Queries
Date: 2001-05-30 18:16:35
Message-ID: Pine.BSF.4.21.0105301111510.6551-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Wed, 30 May 2001, Tom Lane wrote:

> Mark <mark(at)zserve(dot)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.



In response to

Responses

pgsql-sql by date

Next:From: NicolasDate: 2001-05-30 18:22:31
Subject: Distinct Values
Previous:From: MarkDate: 2001-05-30 18:06:00
Subject: Re: Case Insensitive Queries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group