Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 70CD82E004A for ; Fri, 16 May 2008 23:34:35 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16206-09 for ; Fri, 16 May 2008 23:34:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.esilo.com (downloads.esilo.com [63.150.152.211]) by developer.postgresql.org (Postfix) with ESMTP id 8DEBA2E0056 for ; Fri, 16 May 2008 23:34:31 -0300 (ADT) Received: from [192.168.1.103] (c-65-34-212-214.hsd1.fl.comcast.net [65.34.212.214]) (authenticated bits=0) by mail.esilo.com (8.13.1/8.13.1) with ESMTP id m4H2YPB1031497; Fri, 16 May 2008 22:34:25 -0400 Message-ID: <482E443B.8080903@esilo.com> Date: Fri, 16 May 2008 22:34:35 -0400 From: Andrew Chernow User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Tom Lane CC: Merlin Moncure , Andrew Dunstan , Alvaro Herrera , "Patches (PostgreSQL)" Subject: Re: libpq object hooks References: <9458.1210875556@sss.pgh.pa.us> <482C82BA.3090100@esilo.com> <9867.1210877054@sss.pgh.pa.us> <482CD76E.6000202@esilo.com> <17177.1210949948@sss.pgh.pa.us> <482DD3AC.9020207@esilo.com> <20531.1210969396@sss.pgh.pa.us> <18090.1210990759@sss.pgh.pa.us> In-Reply-To: <18090.1210990759@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/347 X-Sequence-Number: 6373 Tom Lane wrote: > ISTM the hook > ought to be able to request that libpq return an out-of-memory failure > for the query, just as would happen if the malloc failure had happened > directly to libpq. > > I am working on this new patch and that is how I have been implementing it. If the eventProc function returns FALSE for creation events (not destruction events), the libpq call that triggered it will fail. For instance: for the creation of result objects "PGEVT_RESULTCREATE", I am clearing the result and returning an error value. I think that is the expected behavior when one calls PQexec and an out-of-memory failure occurs. -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.com/