Re: BUG #8568: PLPGSQL Documentation For CASE Is incorrect

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8568: PLPGSQL Documentation For CASE Is incorrect
Дата
Msg-id 13624.1383092363@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #8568: PLPGSQL Documentation For CASE Is incorrect  (joshuadburns@hotmail.com)
Список pgsql-bugs
joshuadburns@hotmail.com writes:
> Every example within the PLPGSQL "control structures" documentation states
> that the proper syntax for closing a "CASE" statement is to use "END CASE;"

Which it is.

> =====================================
> Example CASE statement with END CASE;
> -------------------------------------
> DO LANGUAGE "plpgsql" $BODY$
> DECLARE my_var INTEGER := 2; BEGIN
>   RAISE NOTICE
>     '%',
>     CASE
>       WHEN my_var = 1 THEN 'one'
>       WHEN my_var = 2 THEN 'two'
>       WHEN my_var = 3 THEN 'three'
>     END CASE;
> END $BODY$;

This is not a case statement, it's a case expression (used within a RAISE
statement).  That's documented under the main SQL grammar, and there
you just say END.  Yeah, I know it's not terribly consistent.

            regards, tom lane

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

Предыдущее
От: joshuadburns@hotmail.com
Дата:
Сообщение: BUG #8568: PLPGSQL Documentation For CASE Is incorrect
Следующее
От: David Johnston
Дата:
Сообщение: Re: BUG #8568: PLPGSQL Documentation For CASE Is incorrect