| От | Tom Lane |
|---|---|
| Тема | Re: PL/pgSQL support to define multi variables once |
| Дата | |
| Msg-id | 23947.1402668242@sss.pgh.pa.us обсуждение |
| Ответ на | PL/pgSQL support to define multi variables once (Quan Zongliang <quanzongliang@gmail.com>) |
| Ответы |
Re: PL/pgSQL support to define multi variables once
|
| Список | pgsql-hackers |
Quan Zongliang <quanzongliang@gmail.com> writes:
> CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$
> DECLARE
> local_a, local_b, local_c text := 'a1----';
> BEGIN
> return local_a || local_b || local_c;
> end;
> $$ LANGUAGE plpgsql;
This does not seem like a terribly good idea from here. The main problem
with the syntax is that it's very unclear whether the initializer (if any)
applies to all the variables or just one. C users will probably think
the latter but your example seems to suggest that you think the former.
I doubt that this adds so much usefulness that it's worth adding confusion
too.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера