json_populate_record issue - TupleDesc reference leak

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: json_populate_record issue - TupleDesc reference leak
Date: 2015-02-23 17:27:03
Message-ID: CAFj8pRD9T7YwWsAXJQHUHQXgU8AV55NujfhtfYEZKFCb-CSdHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

When I tested json_populate_function in test
http://stackoverflow.com/questions/7711432/how-to-set-value-of-composite-variable-field-using-dynamic-sql/28673097#28673097
I found a small issue

create type pt as (a int, b int);

postgres=# select json_populate_record('(10,20)'::pt, '{}');
WARNING: TupleDesc reference leak: TupleDesc 0x7f10fcf41400 (567018,-1)
still referenced
json_populate_record
----------------------
(10,20)
(1 row)

jsonb is ok

postgres=# select jsonb_populate_record('(10,20)'::pt, '{}');
jsonb_populate_record
-----------------------
(10,20)
(1 row)

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henry B Hotz 2015-02-23 17:38:38 Re: SSL renegotiation
Previous Message Andres Freund 2015-02-23 17:22:15 Re: SSL renegotiation