Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
Date
Msg-id 8737mvn3ag.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
List pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 Tom> I didn't much like the "initial_nulls" counter in your patch, but
 Tom> actually there's no reason we can't just push an all-nulls row
 Tom> into the tuplestore immediately on seeing a null, the same way as
 Tom> happens in the last-ditch case at the bottom of
 Tom> ExecMakeTableFunctionResult.  I whacked that around a bit and
 Tom> pushed it.

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.

--
Andrew (irc:RhodiumToad)

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #14226: pg_upgrade for 8.4 to 9.4 failed
Next
From: Tom Lane
Date:
Subject: Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly