Search Postgresql Archives

Re: C Function Memory Management

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

 



Martin French <Martin.French@xxxxxxxxxxxxx> writes:
> So out of curiosity, what would be your approach for data preservation 
> cross call?

Usually I'd allocate the space in fcinfo->flinfo->fn_mcxt (which is a
query-lifespan context) and keep a pointer to it in
fcinfo->flinfo->fn_extra (which is a void * field that a C function
can do what it pleases with).  There are plenty of examples in the
Postgres source code.  If you are looking to cache data longer than
one query then it takes more thought.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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