Thread: Returning Errors from User Defined C-functions

Returning Errors from User Defined C-functions

From
o.blomqvist@secomintl.com (Otto Blomqvist)
Date:
Hello !

I have several functions that are compiled as .so and runs pretty well
under PSQL. However I would like to be able to return errors (for
debugging) using something like this

fprintf(stderr, "BEGIN command failed\n");

Problem is I don't know where this would show up..? In some Postgres
log maybe ? I am not directly calling these functions, they are called
from a Daemon, also written in C running on the same box.

Any ideas ?

Thanks a lot

/Otto Blomqvist

Re: Returning Errors from User Defined C-functions

From
Joe Conway
Date:
Otto Blomqvist wrote:
> I have several functions that are compiled as .so and runs pretty well
> under PSQL. However I would like to be able to return errors (for
> debugging) using something like this

See:
http://www.postgresql.org/docs/current/static/error-message-reporting.html

Joe