Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

Поиск
Список
Период
Сортировка
От philip@adhesivemedia.com (Philip Hallstrom)
Тема Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Дата
Msg-id 200008100201.TAA80522@illiad.adhesivemedia.com
обсуждение исходный текст
Ответ на Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..  (Philip Hallstrom <philip@adhesivemedia.com>)
Список 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 по дате отправления:

Предыдущее
От: kumar1@home.com (Prasanth A. Kumar)
Дата:
Сообщение: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..