checking if jsonb was detoasted and releasing memory

Поиск
Список
Период
Сортировка
От Igor Stassiy
Тема checking if jsonb was detoasted and releasing memory
Дата
Msg-id CAKVOjexbsBBLRyzY3B3_DgohSMuJeqzXXoNVi562dNQ5vtN+-g@mail.gmail.com
обсуждение исходный текст
Ответы Re: checking if jsonb was detoasted and releasing memory
Список pgsql-general
Let us say that the datum of type Datum contains a Jsonb* type.
Then after the call

Jsonb *jb = DatumGetJsonb(datum);

the jb might point to a palloc'ed structure, in case detoasting took place. So the question is if this is the right way to free up the memory after checking that the jb was detoasted?

if ((void *)jb != DatumGetPointer(datum))
pfree(jb); // free if detoasted

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