Hello!
The following still reproduces the crash with the patch:
create type foo as (a int, b int);
create function bar_rec() returns record as $$
declare r record;
begin
r := row(123, power(2,30)::int4)::foo;
alter type foo alter attribute b type text;
return r;
end $$ language plpgsql;
select bar_rec();
And also, shouldn't the following still work?
create type inn2 as (x int, y int);
create type out2 as (a int, b inn2);
create function fp_test() returns out2 as $$
declare r out2;
begin
r := row(1, row(10, 20)::inn2)::out2;
alter type inn2 alter attribute y type text;
r := row(1, row(10, 'hello')::inn2)::out2;
return r;
end $$ language plpgsql;
select fp_test();
-- ERROR: cannot return record variable "r" after composite type
"inn2" was altered
but it only uses out2.