Re: [SQL] upper() and lower() on varchar
От | Maarten Boekhold |
---|---|
Тема | Re: [SQL] upper() and lower() on varchar |
Дата | |
Msg-id | Pine.SUN.3.91.980902153759.8707C-100000@dutepp2.et.tudelft.nl обсуждение исходный текст |
Ответ на | Re: [SQL] upper() and lower() on varchar (Sferacarta Software <sferac@bo.nettuno.it>) |
Список | 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 по дате отправления: