This is a simple question: In PL/pgSQL, how do I select an array of composite objects into a local variable?
I'm on Postgres 13. Here is an example of what I'd like to do:
create type udt_foo as (
col1 numeric,
col2 numeric
);
create or replace procedure bar ()
language plpgsql as
$$
declare
lv_foos udt_foo[];
begin
select ...
into strict lv_foos
from some_table t;
end
$$ ;