Stateful pointers in set-returning functions

From: Ian Pye <ianpye(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Stateful pointers in set-returning functions
Date: 2012-05-24 18:17:35
Message-ID: CAEVWPAXrxCHhPoyc73Tx2K1+FZETKfvFa07f94SvQG=soMPXug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Koposov 2012-05-24 18:19:51 Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile
Previous Message Josh Berkus 2012-05-24 18:12:56 Re: Changing the concept of a DATABASE