[MASSMAIL]CASE control block broken by a single line comment

Поиск
Список
Период
Сортировка
От Michal Bartak
Тема [MASSMAIL]CASE control block broken by a single line comment
Дата
Msg-id CAAVzF_FjRoi8fOVuLCZhQJx6HATQ7MKm=aFOHWZODFnLmjX-xA@mail.gmail.com
обсуждение исходный текст
Ответы Re: CASE control block broken by a single line comment
Список pgsql-hackers
Hello all

The issue described bellow exists in postgresql ver 16.2 (found in some previous major versions)

The documentation defines a comment as:
A comment is a sequence of characters beginning with double dashes and extending to the end of the line
 
When using such a comment within CASE control block, it ends up with an error:

DO LANGUAGE plpgsql $$
DECLARE
    t TEXT = 'a';
BEGIN
    CASE t
        WHEN 'a'  -- my comment
        THEN RAISE NOTICE 'a';
        WHEN 'b'
        THEN RAISE NOTICE 'b';
        ELSE NULL;
    END CASE;
END;$$;


ERROR:  syntax error at end of input
LINE 1: "__Case__Variable_2__" IN ('a'  -- my comment)
                                                      ^
QUERY:  "__Case__Variable_2__" IN ('a'  -- my comment)
CONTEXT:  PL/pgSQL function inline_code_block line 5 at CASE

With Regards
Michal Bartak

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Popcount optimization using AVX512