Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPvTc-0007rq-Gn for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Nov 2018 20:21:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gPvTb-0006DP-0m for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Nov 2018 20:21:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPvTa-0006DI-N9 for pgsql-bugs@lists.postgresql.org; Thu, 22 Nov 2018 20:21:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPvTY-0002Hk-9R for pgsql-bugs@lists.postgresql.org; Thu, 22 Nov 2018 20:21:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wAMKLKm5006765; Thu, 22 Nov 2018 15:21:20 -0500 From: Tom Lane To: Haribabu Kommi cc: 4321ip@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15514: process fails on jsonb_populate_recordset query. see simple example below In-reply-to: References: <15514-59d5b4c4065b178b@postgresql.org> Comments: In-reply-to Haribabu Kommi message dated "Wed, 21 Nov 2018 10:21:39 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6763.1542918080.1@sss.pgh.pa.us> Date: Thu, 22 Nov 2018 15:21:20 -0500 Message-ID: <6764.1542918080@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Haribabu Kommi writes: > Accessing of NULL pointer leads to crash. Attached quick simple patch fixes > the problem. While that stops the crash, it doesn't do what we want, which is to return a valid tupdesc. Without that you get "set-valued function called in context that cannot accept a set" errors. I think the right fix is to force a call of update_cached_tupdesc so that there always is a tupdesc to copy. regards, tom lane