Re: PL/pgSQL RAISE EXCEPTION ignores escape characters even with new E'' string syntax
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: PL/pgSQL RAISE EXCEPTION ignores escape characters even with new E'' string syntax |
| Дата | |
| Msg-id | 27136.1182885679@sss.pgh.pa.us обсуждение |
| Ответ на | PL/pgSQL RAISE EXCEPTION ignores escape characters even with new E'' string syntax ("Donald Fraser" <postgres@kiwi-fraser.net>) |
| Список | pgsql-bugs |
"Donald Fraser" <postgres@kiwi-fraser.net> writes:
> According to the release notes, PostgreSQL still handles escape =
> characters in strings as it has in the past, yet PL/pgSQL functions that =
> use escape characters within the string definition for RAISE EXCEPTION =
> are ignored, unless the function is created using the old style quote =
> definition (not $$).
I think you are confused. plpgsql has never interpreted \n as a return;
if that's happening, it's in the string literal parser that eats the
function body string.
Looking at the source code, it appears that plpgsql's scanner treats
E'' and '' strings the same, which we probably should change sometime
(though the risks for breaking existing functions, perhaps with
unpleasant security implications, seem high). But the examples you
give address what happens when the string is read by CREATE FUNCTION,
not what plpgsql does when running the function.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера