Re: libpq object hooks

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: libpq object hooks
Date: 2008-05-17 02:34:35
Message-ID: 482E443B.8080903@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-05-17 02:54:22 Problems with CVS HEAD compile
Previous Message Tom Lane 2008-05-17 02:19:19 Re: libpq object hooks

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-05-17 08:58:10 Re: [HACKERS] TRUNCATE TABLE with IDENTITY
Previous Message Tom Lane 2008-05-17 02:19:19 Re: libpq object hooks