Re: Is a syscache tuple more like an on-disk tuple or a freshly made one?
| От | Chapman Flack |
|---|---|
| Тема | Re: Is a syscache tuple more like an on-disk tuple or a freshly made one? |
| Дата | |
| Msg-id | 57116E90.2090308@anastigmatix.net обсуждение исходный текст |
| Ответ на | Re: Is a syscache tuple more like an on-disk tuple or a freshly made one? (Alvaro Herrera <alvherre@2ndquadrant.com>) |
| Ответы |
Re: Is a syscache tuple more like an on-disk tuple or a freshly made one?
|
| Список | pgsql-hackers |
On 04/15/16 18:03, Alvaro Herrera wrote: > I suppose you could create a copy of the tuple (SysCacheSearchCopy) and > use that for HeapTupleGetDatum. The problem with the syscache tuple is > that it can go away as soon as you do the ReleaseSysCache -- it lives in > shared_buffers memory, so when it's released the buffer might get > evicted. Sure ... I wasn't going to call ReleaseSysCache until I was all done with it anyway, should only take microseconds ... thought I'd be clever and avoid making a copy, and pass it to existing code expecting a Datum, but I guess that's more trouble than it's worth. > A "syscache tuple" is definitely an on-disk tuple. Got it. Thanks! On 04/15/16 18:13, Tom Lane wrote: > You could use heap_copy_tuple_as_datum(). Thanks, that looks like what the doctor ordered. For pre-9.4, would the equivalent be basically heap_form_tuple applied to the results of heap_deform_tuple ? -Chap
В списке pgsql-hackers по дате отправления: