Re: Reference Leak with type

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Rohit Bhogate <rohit.bhogate@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2021-04-06T12:19:52Z
Lists: pgsql-hackers
On Tue, Apr 06, 2021 at 11:09:13AM +0530, Rohit Bhogate wrote:
>  I found the below reference leak on master.

Thanks for the report.  This is indeed a new problem as of HEAD,
coming from c9d52984 as far as I can see, and 13 does not support this
grammar.  From what I can see, there seems to be an issue with the
reference count of the TupleDesc here, your test case increments two
times a TupleDesc for this custom type in a portal, and tries to
decrement it three times, causing what looks like a leak.
--
Michael

Commits

  1. Redesign the caching done by get_cached_rowtype().