Re: Error handling in C API function calls in a way that doesn't close client connection - Mailing list pgsql-general

From Tom Lane
Subject Re: Error handling in C API function calls in a way that doesn't close client connection
Date
Msg-id 16117.1428037257@sss.pgh.pa.us
Whole thread Raw
In response to Error handling in C API function calls in a way that doesn't close client connection  (Igor Stassiy <istassiy@gmail.com>)
List pgsql-general
Igor Stassiy <istassiy@gmail.com> writes:
> This question refers to version 9.4 of Postgres. I have have a function

> Datum do_something(PG_FUNCTION_ARGS)
> {
>     ...
>     if(error_occured) {
>         ereport(ERROR, (errmsg("some error occured")));
>     }
>     ...
> }

> When I call do_something in a way to deliberately cause the error
> condition, the client connection (psql) is terminated,

[ shrug... ]  You did not show us whatever is causing that problem.

Given a self-contained example, it would be possible to offer some
useful advice.  On the basis of what you've said here, though, I can
only suggest that you're looking for the problem in the wrong place.

            regards, tom lane


pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: quick q re execute & scope of new
Next
From: "Andrew J. Kopciuch"
Date:
Subject: Re: quick q re execute & scope of new