Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSOGg-0005jV-4U for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jul 2016 12:48:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bSOGf-0006xv-Dk for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jul 2016 12:48:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSOGe-0006xd-NB for pgsql-bugs@postgresql.org; Wed, 27 Jul 2016 12:48:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSOGc-0001D3-D8 for pgsql-bugs@postgresql.org; Wed, 27 Jul 2016 12:48:55 +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 u6RCmqYD029060; Wed, 27 Jul 2016 08:48:53 -0400 From: Tom Lane To: Andrew Gierth cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly In-reply-to: <8737mvn3ag.fsf@news-spur.riddles.org.uk> References: <87wpkcpyud.fsf@news-spur.riddles.org.uk> <18501.1469285358@sss.pgh.pa.us> <87eg6koste.fsf@news-spur.riddles.org.uk> <4240.1469583457@sss.pgh.pa.us> <8737mvn3ag.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Wed, 27 Jul 2016 04:59:50 +0100" Date: Wed, 27 Jul 2016 08:48:52 -0400 Message-ID: <29059.1469623732@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andrew Gierth writes: > I did think about that, but the existing code seems to go out of its way > to build the tuplestore using the tupdesc obtained from the actual > function result row, rather than the "expected" tupdesc, and it wasn't > really obvious why that was. As I noted in a comment, the key hazard would be that heap_form_tuple copies the tupdesc's type identifier info into the created composite Datum, thus possibly leading to a mixture of type IDs in the stored tuples. But tuplestore stores MinimalTuples which omit that data, so it doesn't matter. I have a feeling that the existing code here might've been older than the changes to store MinimalTuples rather than regular tuple datums in tuplestores; or at least, it was written with the assumption that that was important. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs