[postgis-users] Error handling and reporting with liblwgeom functions

Igor Stassiy istassiy at gmail.com
Mon Mar 30 06:59:33 PDT 2015


Hello,

I am developing an extension for postgres that links dynamically with
liblwgeom. I am new to the subject to please bear with me.

>From what I understand, the errors are reported via:

static void default_errorreporter(const char *fmt, va_list ap);
lwreporter lwerror_var = default_errorreporter;

and default error reporter calls exit(1). This would terminate the current
connection to the database, however then liblwgeom is used from within
postgis (> 2.0), these callbacks are overriden with the call:

_PG_init(void)

in

https://github.com/postgis/postgis/blob/426d8414298272b4ace32e361a40adfd081b2e60/postgis/postgis_module.c#L44

which calls elog or ereport and those function calls in turn also terminate
transaction but in a different way.

So the question is it assumed that anything reported with lwerror not
recoverable and should terminate the current transaction and client
connection?

Thank you,
Igor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150330/6f331e3d/attachment.html>


More information about the postgis-users mailing list