Search Postgresql Archives

checking if jsonb was detoasted and releasing memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux