Re: Saving SRF context

From: Salvador Fandiño <sfandino(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Saving SRF context
Date: 2016-03-12 11:59:16
Message-ID: 56E40494.3050305@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/11/2016 09:19 PM, Salvador Fandiño wrote:
> Hi,
>
> I have implemented a SRF[*] that returns rows one by one (using
> ExprMultipleResult). But now I need to save somewhere some context
> information between calls pertaining to the same result set and I am
> unable to find a proper place for that.
>
> I have seen that cfinfo->flinfo->fn_extra is available, but if I
> understand the mechanics of FmgrInfo correctly, that structure is not
> unique for call frame. It could be shared between several cfinfo
> structures and would be crushed on recursion (I plan to use SPI from my
> function).
>
> So, is that right? should I build a stack there? is there any other
> place where to store context information relative to a SRF call frame?

Replying to myself, pretty much I wanted to know is documented here:

http://www.postgresql.org/docs/devel/static/xfunc-c.html

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2016-03-12 12:17:46 Re: pam auth - add rhost item
Previous Message Amit Kapila 2016-03-12 11:08:12 Re: Background Processes and reporting