[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.2-15-ge60d72a80

git at osgeo.org git at osgeo.org
Fri Feb 3 20:56:23 PST 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.3 has been updated
       via  e60d72a80d2e5ccd9d22fcfe61120a34f101dea9 (commit)
       via  404b11de50a4715123c2f203353f192f927c1bee (commit)
      from  0134ee7202de4389c1f02645cf265878d6d9d6a3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e60d72a80d2e5ccd9d22fcfe61120a34f101dea9
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Feb 3 20:56:16 2023 -0800

    NEWS item for #5332

diff --git a/NEWS b/NEWS
index 26e902e90..755e87b2b 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ YYYY/MM/DD
   - #5106, Fix segfault in ST_RemEdgeNewFace/ST_RemEdgeModFace
            when no edge side-faces are found (Sandro Santilli)
   - #5329, Fix downgrade protection introduced in 3.3.0 (Sandro Santilli)
+  - #5332, Keep proj errors from percolating into PgSQL log (Paul Ramsey)
+
 
 PostGIS 3.3.2
 2022/11/12

commit 404b11de50a4715123c2f203353f192f927c1bee
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Feb 3 20:30:15 2023 -0800

    When libproj throws at error, don't just write the
    message to stderr. Catch it and put it into the
    PgSQL log at a DEBUG level.
    We check all return values and return codes when
    calling into the proj API, so the extra error messages
    don't really help us.
    This is in response to our calls to proj_create()
    dumping messages into stderr, which confuses operators.
    Our projection code has to try a bunch of possible
    strings to instantiate projection objects, some of
    which fail (generating a message) and then we fall
    back to the next string. The proj "errors" are not
    errors from our pov, so we catch them and send them
    along at much lower priority.
    References #5332

diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c
index 1018b92ca..0b54160e3 100644
--- a/postgis/postgis_module.c
+++ b/postgis/postgis_module.c
@@ -58,6 +58,21 @@ static void interruptCallback() {
 static ExecutorStart_hook_type onExecutorStartPrev = NULL;
 static void onExecutorStart(QueryDesc *queryDesc, int eflags);
 
+/*
+* Pass proj error message out via the PostgreSQL logging
+* system instead of letting them default into the
+* stderr.
+*/
+#if POSTGIS_PROJ_VERSION > 50
+#include "proj.h"
+
+static void
+pjLogFunction(void* data, int logLevel, const char* message)
+{
+	elog(DEBUG1, "libproj threw an exception (%d): %s", logLevel, message);
+}
+#endif
+
 /*
  * Module load callback
  */
@@ -75,6 +90,11 @@ _PG_init(void)
   /* install PostgreSQL handlers */
   pg_install_lwgeom_handlers();
 
+  /* pass proj messages through the pgsql error handler */
+#if POSTGIS_PROJ_VERSION > 50
+  proj_log_func(NULL, NULL, pjLogFunction);
+#endif
+
   /* setup hooks */
   onExecutorStartPrev = ExecutorStart_hook;
   ExecutorStart_hook = onExecutorStart;

-----------------------------------------------------------------------

Summary of changes:
 NEWS                     |  2 ++
 postgis/postgis_module.c | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list