Re: [SQL] upper() and lower() on varchar - Mailing list pgsql-sql

From Maarten Boekhold
Subject Re: [SQL] upper() and lower() on varchar
Date
Msg-id Pine.SUN.3.91.980902153759.8707C-100000@dutepp2.et.tudelft.nl
Whole thread Raw
In response to Re: [SQL] upper() and lower() on varchar  (Sferacarta Software <sferac@bo.nettuno.it>)
List pgsql-sql
On Wed, 2 Sep 1998, Sferacarta Software wrote:

> marted�, 1 settembre 98, you wrote:
>
> MB> Hi,
>
> MB> Is there a way to get upper() and lower() to work on a varchar column? It
> MB> seems like these functions are only defined on the text datatype (in 6.3.2).
>
> MB> I guess what I need in this case is some way to convert varchar to text.
> MB> Will (text_in(varchar_out(column)) work?
>
>
> It works for me (6.3.2)
> take a look:
>
> create table a(a varchar(10));
> insert into a values ('AAA');
> insert into a values ('aaa');
>
> select * from tbl;
> fld
> ---
> aaa
> AAA
> (2 rows)
>
> select * from tbl where upper(fld)='AAA';
> fld
> ---
> aaa
> AAA
> (2 rows)

I tried some stuff, and

    select lower(aroms) from product where aroms='VAUGHAN STEVIE RAY'

works, but:

    select * from product where lower(aroms)='vaughan stevie ray';
FATAL 1:  palloc failure: memory exhausted

And:

    rockhouse=> create index product_lower on product (lower(aroms));
    ERROR:  DefineIndex: (null) class not found

Anybody knows if I'm doing something wrong here? This is a 6.3.2 system
with all patches from ftp.postgresql.org applied, plus the patch for
enabling functional indices.

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems  |
|                   Department of Electrical Engineering                    |
|           Computer Architecture and Digital Technique section             |
|                          M.Boekhold@et.tudelft.nl                         |
-----------------------------------------------------------------------------


pgsql-sql by date:

Previous
From: Sferacarta Software
Date:
Subject: Re: [SQL] upper() and lower() on varchar
Next
From: Ronnie Doggart
Date:
Subject: Help with setting up table and importing data.