[HACKERS] SPI cursor functions

2008-10-24 Thread Tim Keitt
The docs for FETCH indicate you can fetch from the current row using FORWARD 0, but SPI_scroll_cursor_fetch(someportal, FETCH_FORWARD, 0); fails for me. Is there a way to emulate FETCH FORWARD 0 with SPI? Also, I noticed that SPI_scroll_cursor_move(someportal, FETCH_BACKWARD, 1); sets S

Re: [HACKERS] SPI cursor functions

2008-10-27 Thread Tim Keitt
On Fri, Oct 24, 2008 at 7:57 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Tim Keitt" <[EMAIL PROTECTED]> writes: >> The docs for FETCH indicate you can fetch from the current row using >> FORWARD 0, but > >> SPI_scroll_cursor_fetch(someportal, FETCH_

[HACKERS] pointer scope and memory contexts

2008-11-05 Thread Tim Keitt
I am working on a set returning function and have a question about switching memory contexts. Basically, what I want to know is whether memory allocated in one context can be referenced when a different context is current. The docs give examples like: if (SRF_IS_FIRSTCALL()) { fun

[HACKERS] Question about SPI_prepare

2008-11-11 Thread Tim Keitt
I have an application where I am building a plan with SPI_plan and then this plan is called multiple times. There is one free parameter ($1) to the plan. The issue is with the order of the values returned. If $1 is identical during successive calls to SPI_execute_plan, is there any guarantee that t