Re: BUG #15246: Does not allow an INOUT parameter to receive valueswhen its data type is a user-defined data type. - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #15246: Does not allow an INOUT parameter to receive valueswhen its data type is a user-defined data type.
Date
Msg-id CAKFQuwYfUe7r43DC52u6YdDfBRepyT5d3VczcTtXUukE8QRscQ@mail.gmail.com
Whole thread Raw
In response to BUG #15246: Does not allow an INOUT parameter to receive values whenits data type is a user-defined data type.  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15246: Does not allow an INOUT parameter to receive values when its data type is a user-defined data type.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Mon, Jun 18, 2018 at 3:32 PM, PG Bug reporting form <noreply@postgresql.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.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15246: Does not allow an INOUT parameter to receive values whenits data type is a user-defined data type.
Next
From: Amit Langote
Date:
Subject: Re: BUG #15245: pg_stat_all_tables does not include partition mastertables