Re: elog in 7.4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: elog in 7.4
Date
Msg-id 22917.1095721907@sss.pgh.pa.us
Whole thread Raw
In response to elog in 7.4  (Laszlo Hornyak <kocka@forgeahead.hu>)
List pgsql-hackers
Laszlo Hornyak <kocka@forgeahead.hu> writes:
> I have a error callback function registered to run each time an SQL 
> error occurs. The problem is that the errfinish() calls it both if the 
> executed SQL statement was wrong, and if the statem,ent or plan logging 
> is enabled, and it seems elog.h doesn't provide the API to find out the 
> reason why my callback was called.

I suspect you are abusing the callback mechanism to do something it was
not intended for.  Callbacks are supposed to supply information for the
error message context field, *and nothing else*.  You'll probably break
things if you go outside that charter.  Accordingly, I see no reason why
a callback should care why it was called.

What are you trying to accomplish, really?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Disabling bgwriter on my notebook
Next
From: Gaetano Mendola
Date:
Subject: Re: RSS