Re: BUG #15246: Does not allow an INOUT parameter to receive values when its data type is a user-defined data type.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: anderson(dot)ant(dot)oli(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15246: Does not allow an INOUT parameter to receive values when its data type is a user-defined data type.
Date: 2018-06-18 22:41:42
Message-ID: CAKFQuwYfUe7r43DC52u6YdDfBRepyT5d3VczcTtXUukE8QRscQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2018-06-19 01:24:14 Re: BUG #15245: pg_stat_all_tables does not include partition master tables
Previous Message PG Bug reporting form 2018-06-18 22:32:14 BUG #15246: Does not allow an INOUT parameter to receive values when its data type is a user-defined data type.