Re: Error handling in C API function calls in a way that doesn't close client connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Igor Stassiy <istassiy(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error handling in C API function calls in a way that doesn't close client connection
Date: 2015-04-03 05:00:57
Message-ID: 16117.1428037257@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Igor Stassiy <istassiy(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew J. Kopciuch 2015-04-03 06:00:54 Re: quick q re execute & scope of new
Previous Message Scott Ribe 2015-04-03 04:59:38 Re: quick q re execute & scope of new