Re: Using Expanded Objects other than Arrays from plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using Expanded Objects other than Arrays from plpgsql
Дата
Msg-id 1947217.1730499609@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Using Expanded Objects other than Arrays from plpgsql  (Michel Pelletier <pelletier.michel@gmail.com>)
Ответы Re: Using Expanded Objects other than Arrays from plpgsql
Список pgsql-hackers
Michel Pelletier <pelletier.michel@gmail.com> writes:
> Here's two backtraces from gdb from this function:
> CREATE OR REPLACE FUNCTION test2(graph matrix)
>     RETURNS bigint LANGUAGE plpgsql AS
>     $$
>     BEGIN
>     perform set_element(graph, 1, 1, 1);
>     RETURN nvals(graph);
>     end;
>     $$;

Well, you shouldn't be using PERFORM.  Not only does it not do the
right thing, but it's not optimized for expanded objects at all:
they'll get flattened both on the way into the statement and on
the way out.  Try it with

     graph := set_element(graph, 1, 1, 1);
     RETURN nvals(graph);

            regards, tom lane



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