Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
Дата
Msg-id 29059.1469623732@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #14150: Attempted to delete invisible tuple