Re: PL/pgSQL support to define multi variables once

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
Re: PL/pgSQL support to define multi variables once
Дата
Msg-id
CAFj8pRCrwgcKKdcwWhxPrW7xU2rU8BfVb-FYJT1Sb1nz16hzrg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
PL/pgSQL support to define multi variables once Quan Zongliang <quanzongliang@gmail.com>
Re: PL/pgSQL support to define multi variables once Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PL/pgSQL support to define multi variables once Tom Lane <tgl@sss.pgh.pa.us>
Re: PL/pgSQL support to define multi variables once Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL support to define multi variables once Andres Freund <andres@2ndquadrant.com>
Re: PL/pgSQL support to define multi variables once Tom Lane <tgl@sss.pgh.pa.us>
Re: PL/pgSQL support to define multi variables once David G Johnston <david.g.johnston@gmail.com>
Re: PL/pgSQL support to define multi variables once Tom Lane <tgl@sss.pgh.pa.us>
Re: PL/pgSQL support to define multi variables once Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL support to define multi variables once David Johnston <david.g.johnston@gmail.com>
Re: PL/pgSQL support to define multi variables once Robert Haas <robertmhaas@gmail.com>
Re: PL/pgSQL support to define multi variables once Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL support to define multi variables once Ian Barwick <ian@2ndquadrant.com>
Re: PL/pgSQL support to define multi variables once Quan Zongliang <quanzongliang@gmail.com>
Re: PL/pgSQL support to define multi variables once Michael Paquier <michael.paquier@gmail.com>
Re: PL/pgSQL support to define multi variables once Pavel Stehule <pavel.stehule@gmail.com>
Re: PL/pgSQL support to define multi variables once Michael Paquier <michael.paquier@gmail.com>
Re: PL/pgSQL support to define multi variables once Pavel Stehule <pavel.stehule@gmail.com>
We can disallow custom initialization when when variables are declared as list.

Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too.

Regards

Pavel


2014-06-13 16:04 GMT+02:00 Tom Lane <tgl@sss.pgh.pa.us>:
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


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления
От: Fujii Masao
Дата:
Сообщение: Re: Audit of logout
От: Andres Freund
Дата:
FAQ