On Mon, Jun 18, 2018 at 3:32 PM, PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:
>
> begin
> p_my_type.rc_tbl1.co_1 := 1; -- ERRO: "p_my_type.rc_tbl1.co_1" is
> not
> variable unknown !!!!
> p_my_type.rc_tbl1.co_2 := 'Teeeeeeeeeest';
> p_my_type.rc_tbl2.co_3 := 'T';
> p_my_type.rc_tbl2.co_4 := 10.56;
> end;
>
Short answer is that you cannot simply assign components of a composite
type one-at-a-time, you have to build up the full final composite result in
one expression and assign the result of the expression to the typed
variable (p_my_type in this instance).
This works:
p_my_type := ROW(ROW(1, 'Teeeeeeeeeeest'), ROW('T', 10.56));
and execute:
select * FROM fc_test(null)
David J.