Re: elog in 7.4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: elog in 7.4
Date
Msg-id 147.1095774278@sss.pgh.pa.us
Whole thread Raw
In response to elog in 7.4  (Laszlo Hornyak <kocka@forgeahead.hu>)
Responses Re: elog in 7.4
List pgsql-hackers
Laszlo Hornyak <kocka@forgeahead.hu> writes:
> I am implementing a java language handler. If unrecoverable error occurs,
> it needs to send a signal to the java process, so it can stop the
> execution of the stored procedure, otherwise it would stay in inconsystent
> state.

Well, an elog callback is certainly the wrong place for that.  Even if
it looked to see whether the elog call was ERROR or not, an ERROR is no
longer necessarily unrecoverable --- it might be caught inside a plpgsql
exception block, for example, and not really be an error at all from the
perspective of calling code.

The right way would be to use PG_TRY to catch the exception as it
propagates out to your own level of control.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Sudhakar Kurumella
Date:
Subject: Re: psql: FATAL: Password authentication failed for
Next
From: Alvaro Herrera
Date:
Subject: Re: SSL Support