[postgis-users] Postgis 3.1.0 st_makevalid crashes the PostgreSQL Server

Fatih Sazan fatihsazan01 at gmail.com
Sun Jan 24 23:19:42 PST 2021


When I run my code running on PostGIS version 2.5, I don't get an error but
when I run it on 3.1 it the server gives an error and enters the recovery
mode every time.

pgadmin4 messages:(*"Connection to the server has been lost."*).

postgresql log : "*WARNING:  terminating connection because of crash
of another server process
DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back
the current transaction and exit, because another server process
exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.
CONTEXT:  SQL statement "SELECT (*

I have installed PostgreSQL on a separate server. Here I also get an error
that PostgreSQL crashes due to the PostGIS function (eg:st_makevalid). In
my opinion, there is a problem arising from the PostGIS version.

Can you try the queries yourself by trying on PostGIS extension versions
3.1.0 to 2.5?

I think we can see if there is a general problem of PostGIS 3.1.0 version.

PostGIS 3.1.0 - Query that raised an error:

select st_makevalid(
        st_force2d(
            st_multi(
                st_buffer(st_setsrid(ST_GeomFromGeoJSON(geometry), 4326), 0)
            )
        )::geometry (multipolygon, 4326)
    )from (
        select j->'geometry' as geometry
        from (
                select (

'{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[39.75359,37.23446],[39.75359,37.23449],[39.75359,37.23415],[39.75391,37.23409],[39.7539,37.2341],[39.75373,37.23413],[39.75359,37.23446]]]}}'::json
                    ) as j
            ) t1
    ) t1

PostGIS 3.1.0 - Query that works without any problem:

select st_makevalid(
        st_force2d(
            st_multi(
                st_buffer(st_setsrid(ST_GeomFromGeoJSON(geometry), 4326), 0)
            )
        )::geometry (multipolygon, 4326)
    )from (
        select j->'geometry' as geometry
        from (
                select (

'{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[28.89686,41.00149],[28.89698,41.00147],[28.89704,41.00157],[28.89693,41.0016],[28.89686,41.00149]]]}}'::json
                    ) as j
            ) t1
    ) t1

Operating System: CentOS Linux 8
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-193.28.1.el8_2.x86_64
Architecture: x86-64

postgresql-13
extension : postgis vers. 3.1.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210125/84f3278a/attachment.html>


More information about the postgis-users mailing list