Re: plpgsql select into - Mailing list pgsql-novice

From Tom Lane
Subject Re: plpgsql select into
Date
Msg-id 1915560.1629475660@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpgsql select into  (Roger Mason <rmason@mun.ca>)
Responses Re: plpgsql select into
List 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 by date:

Previous
From: Roger Mason
Date:
Subject: Re: plpgsql select into
Next
From: "David G. Johnston"
Date:
Subject: Re: plpgsql select into