Re: plpgsql select into

From: Roger Mason <rmason(at)mun(dot)ca>
To:
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: plpgsql select into
Date: 2021-08-20 15:34:20
Message-ID: y657dggnn9f.fsf@mun.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello Tom & Laurenz,

Thanks for your responses.

Laurenz Albe writes:

> Omit "INTO tabular_info" from the query.
> RETURN QUERY already is a destination for the query result.

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)

How do I access the data in 'info_table'?

Thanks,
Roger

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2021-08-20 16:07:40 Re: plpgsql select into
Previous Message Laurenz Albe 2021-08-20 14:13:47 Re: plpgsql select into