Re: switch statement in plpgsql

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: switch statement in plpgsql
Дата
Msg-id 1059503235.22265.874.camel@camel
обсуждение исходный текст
Ответ на switch statement in plpgsql  (Godshall Michael <Michael_Godshall@gmachs.com>)
Список pgsql-novice
On Tue, 2003-07-29 at 12:18, Godshall Michael wrote:
> Hello,
>
> Is it possible to use a case switch statement in a plpgsql function or
> must I use If-Else statements only?
>
> If so what is the format?
>
> I have tried the following which when compiled is accepted but when I
> call the function it crashes.
>
> switch(tregion)
>
> {
>
> case : ''San Ramon'' then tregion := ''San Ramon, CA'';
>
> break;
>
> }
>

It is not currently possible in plpgsql (though I believe it is possible
in some of the other function languages).

You could probably lobby to have it put on the TODO list (I agree there
are times when it would be nice to have), though the IF...ELSIF..ELSE
construct can usually serve the same purpose.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


В списке pgsql-novice по дате отправления:

Предыдущее
От: Dmitry Tkach
Дата:
Сообщение: Re: help: now() + N is now failing!
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Re: help: now() + N is now failing!