Re: plpgsql select into

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql select into
Дата
Msg-id 1915560.1629475660@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: plpgsql select into  (Roger Mason <rmason@mun.ca>)
Ответы Re: plpgsql select into  (Roger Mason <rmason@mun.ca>)
Список pgsql-novice
Roger Mason <rmason@mun.ca> writes:
> Yes, if I omit the INTO clause I get data returned.  So then how do I
> insert the result of the plpgsql call into a table?  This is what
> happens if I try calling 'select into' in psql:

> select into info_table from (select get_info('1043_1')) as info_split;
> SELECT 1288
> test=> select * from info_table ;
> --
> (1288 rows)

You selected zero columns (which psql is not very good at displaying :-().
Try

select * into info_table from (select get_info('1043_1')) as info_split;

BTW, that could be simplified a lot:

select * into info_table from get_info('1043_1');

            regards, tom lane



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

Предыдущее
От: Roger Mason
Дата:
Сообщение: Re: plpgsql select into
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: plpgsql select into