Stateful pointers in set-returning functions - Mailing list pgsql-hackers

From Ian Pye
Subject Stateful pointers in set-returning functions
Date
Msg-id CAEVWPAXrxCHhPoyc73Tx2K1+FZETKfvFa07f94SvQG=soMPXug@mail.gmail.com
Whole thread Raw
Responses Re: Stateful pointers in set-returning functions
List pgsql-hackers
Hi,

I'm writing a set-returning function which places a file handle into
PG's FuncCallContext's user_fctx space. My problem is that when the
function is ran with a limit clause (SELECT * FROM foo() LIMIT 10) the
server will stop calling the function automatically, not giving me a
chance to close the file handle. Is there a way to get the limit value
inside of foo() and set the max max_calls parameter correctly?

Thanks,

Ian


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Changing the concept of a DATABASE
Next
From: Sergey Koposov
Date:
Subject: Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile