Reference Leak with type

Rohit Bhogate <rohit.bhogate@enterprisedb.com>

From: Rohit Bhogate <rohit.bhogate@enterprisedb.com>
To: pgsql-hackers@postgresql.org
Date: 2021-04-06T05:39:13Z
Lists: pgsql-hackers
Hi All ,

 I found the below reference leak on master.

Steps to reproduce the issue :
--1) create type
create type float_array_typ as ( i float8);

--2) create anonymous block
postgres=# do $$
 declare
  a float_array_typ[];
 begin
  a[1].i := 11;
  commit;
 end
$$;
WARNING:  TupleDesc reference leak: TupleDesc 0x7ff7673b15f0 (16386,-1)
still referenced
ERROR:  tupdesc reference 0x7ff7673b15f0 is not owned by resource owner
TopTransaction
postgres=#

*Regards,*
Rohit

Commits

  1. Redesign the caching done by get_cached_rowtype().