Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX.. - Mailing list pgsql-general

From philip@adhesivemedia.com (Philip Hallstrom)
Subject Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Date
Msg-id 200008100201.TAA80522@illiad.adhesivemedia.com
Whole thread Raw
In response to Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..  (Philip Hallstrom <philip@adhesivemedia.com>)
List pgsql-general
In article <am.pgsql.general.965867637.80159@illiad.adhesivemedia.com>,
Prasanth A. Kumar <kumar1@home.com> wrote:
>Philip Hallstrom <philip@adhesivemedia.com> writes:
>
>> Hi -
>>     The following statements lock up my machine completely (I can
>> ping, but can't telnet, nothing).  This is FreeBSD 3.4-STABLE running
>> 7.0.2.
>>
>> rolo_entry.fname is of type VARCHAR(30).
>>
>> devloki=> CREATE FUNCTION upper(VARCHAR) RETURNS TEXT AS '
>> devloki'>   BEGIN
>> devloki'>   RETURN UPPER($1);
>> devloki'>   END;
>> devloki'> ' LANGUAGE 'plpgsql';
>> CREATE
>> devloki=> CREATE INDEX foo_idx ON rolo_entry (upper(fname));
>>
>> If I rename the function to say "am_upper" it works just fine.
>>
>> ???
>
>I'm guessing that since sql is case insensitive, that results in
>infinite recursion because you have a function upper() which calls
>UPPER().
Oh... Duh!!!  Geesh... for some reason I figured it would call the
"built-in" UPPER, but obviously it won't. ha ha ha.  *sigh*
My next question then is how to get around this?  I could just rename my
function but it's nice to leave it UPPER since that is what it does.  Is
there another function that will uppercase?  Or is there some way to
call the other UPPER function?  Or something within plpgsql I don't know
about.
Thanks!
-philip


pgsql-general by date:

Previous
From: kumar1@home.com (Prasanth A. Kumar)
Date:
Subject: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Next
From: Lamar Owen
Date:
Subject: Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..