[postgis-users] Error handling and reporting with liblwgeom functions
Paul Ramsey
pramsey at cleverelephant.ca
Mon Mar 30 08:21:38 PDT 2015
In answer to your question, yes, lwerror has basically the same
semantic meaning as elog(ERROR,...), that is: we're done here we
cannot process the query any further.
P.
On Mon, Mar 30, 2015 at 6:59 AM, Igor Stassiy <istassiy at gmail.com> wrote:
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list