pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Guryanow <gav@nlr.ru>
To: Mitch Vincent <mitch@venux.net>
Cc: pgsql-sql@postgresql.org
Subject: Re[2]: lower() for varchar data by creating an index
Date: Thu, 18 May 2000 15:34:53 +0400
Message-ID: <5649.000518@nlr.ru> (raw)
In-Reply-To: <00d901bfc00c$a3a36c00$4100000a@venux.net>
References: <00d901bfc00c$a3a36c00$4100000a@venux.net>

OK, but how can I delete this function? By attempting to remove it I've got an error:

my-db=> DROP FUNCTION lower(varchar);
ERROR:  RemoveFunction: function "lower" is built-in

I want to delete it because I receive strange sorting results (you can read about them in my mail with
subj "strange ORDER BY implementation").

Alex


Wednesday, May 17, 2000, 6:31:50 PM Mitch wrote:

MV> CREATE function lower(varchar) returns text as 'lower' language 'internal'
MV> with (iscachable);

MV> It's a bit slower than if it was actually in the backend but it's a very
MV> tiny difference. I spoke to Tom Lane about this, it's on the TODO list I
MV> believe for 7.1. In the meantime the above will work great..


MV> - Mitch

MV> "The only real failure is quitting."


MV> ----- Original Message -----
MV> From: Alex Guryanow <gav@nlr.ru>
MV> To: <pgsql-sql@postgresql.org>
MV> Sent: Wednesday, May 17, 2000 3:51 AM
MV> Subject: [SQL] lower() for varchar data by creating an index


>> Hi,
>>
>> I have a table called t1 with field f1 of type varchar(40):
>>
>>   CREATE TABLE t1 (f1 varchar(40));
>>
>> To make a case insensitive search I build the query like
>>
>>    SELECT f1 FROM t1 WHERE lower( f1 ) LIKE 'alex%';
>>
>> This works fine. But when I try to make an index to speed up the query
MV> using the command
>>
>>      CREATE INDEX t1_f1_idx ON t1 (lower(f1));
>>
>> I receive the following error:
>>
>>   ERROR:  DefineIndex: function 'lower(varchar)' does not exist
>>
>> Why by executing the query the function 'lower(varchar)' exists and by
MV> creating the index don't?
>>
>> I use Postgres 7.0.
>>
>> Best regards,
>> Alex
>>
>>
>>





view thread (8+ messages)  latest in thread

Message-ID: <5649.000518@nlr.ru>
Permalink:  ../5649.000518@nlr.ru/
Also on:    postgresql.org/message-id/5649.000518@nlr.ru

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: gav@nlr.ru, mitch@venux.net
  Subject: Re: lower() for varchar data by creating an index
  In-Reply-To: <5649.000518@nlr.ru>
  References: <00d901bfc00c$a3a36c00$4100000a@venux.net> <5649.000518@nlr.ru>

* 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