The following bug has been logged on the website:
Bug reference: 15246
Logged by: Anderson Antunes
Email address: anderson.ant.oli@gmail.com
PostgreSQL version: 10.0
Operating system: Windows
Description:
I'm trying to assign a popular values to a custom data type that comes from
an INOUT parameter in the function. I already searched the internet and I
did not find a solution. This type of assignment is common in Oracle. I do
not understand why it was not implemented. I get the following message:
"ERROR:" Parameter XXX "is not variable unknown".
Thank you if you can answer me.
create table my_table1
(
co_1 integer,
co_2 character varying(20)
);
create table my_table2
(
co_1 char,
co_2 double precision
);
create type my_type as
(
rc_tb1 my_table1,
rc_tb2 my_table2
);
create or replace function fc_test
(
inout p_my_type my_type
)
as
$$
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;
$$
language plpgsql;