Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers
Дата
Msg-id 20140407192815.GL4161@awork2.anarazel.de
обсуждение исходный текст
Ответы Re: Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I've the need to persist a the result of an index_getnext() in a tuple
slot. I don't want to unneccessarily duplicate the tuple data itself, so
I'd like to use ExecStoreTuple(buffer = real_buffer) notion. But since
the next index_getnext()/index_endscan() will overwrite/release the
heaptuple I need to copy the HeapTupleData().
It'd be rather useful to be able to do ExecStoreTuple(tuple, slot,
some_buffer, true), i.e. hav ethe HeapTupleData struct freed *and* the
buffer pinned. There's an Assert preventing that though.

Why?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: "Transaction local" statistics are incorrect at speed
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: "Transaction local" statistics are incorrect at speed