[postgis-tickets] [PostGIS] #5181: Invalid PROJ string in ST_Transform breaks subsequent queries

PostGIS trac at osgeo.org
Mon Jul 4 06:31:18 PDT 2022


#5181: Invalid PROJ string in ST_Transform breaks subsequent queries
-------------------------------+---------------------------
 Reporter:  kszafran           |      Owner:  pramsey
     Type:  defect             |     Status:  new
 Priority:  medium             |  Milestone:  PostGIS 3.2.2
Component:  postgis            |    Version:  3.2.x
 Keywords:  st_transform proj  |
-------------------------------+---------------------------
 If I call `ST_Transform` with a valid SRID, then with an invalid PROJ
 string, and then a valid SRID, the third query fails with some error. I
 have tested this on a few different setups and the exact error differs
 between them.

 To reproduce, run these queries one after another:
 {{{
 test=# SELECT ST_Transform(ST_SetSRID(ST_MakePoint(1, 2), 4326), 3875);
 ... (correct response)

 test=# SELECT ST_Transform(ST_SetSRID(ST_MakePoint(1, 2), 4326), '+wat');
 ERROR:  could not parse proj string '+wat'
 CONTEXT:  SQL function "st_transform" statement 1

 test=# SELECT ST_Transform(ST_SetSRID(ST_MakePoint(1, 2), 4326), 3875);
 ERROR:  (message depends on the setup, see below)

 test=# SELECT ST_Transform(ST_SetSRID(ST_MakePoint(1, 2), 4326), 3875);
 ... (correct response)
 }}}

 Here are the setups I've tested and the error they give:

 1. Running a custom Docker image:
 {{{
 PostgreSQL 12.9 on x86_64-pc-linux-musl, compiled by gcc (Alpine
 10.3.1_git20211027) 10.3.1 20211027, 64-bit
 POSTGIS="3.1.5 0" [EXTENSION] PGSQL="120" GEOS="3.10.2-CAPI-1.16.0"
 PROJ="8.2.0" GDAL="GDAL 3.4.3, released 2022/04/22" LIBXML="2.9.14"
 LIBJSON="0.15" LIBPROTOBUF="1.4.0" WAGYU="0.5.0 (Internal)" TOPOLOGY
 RASTER

 ERROR:  transform: Unknown error (code 4096) (4096)
 }}}

 2. Running in AWS Aurora:
 {{{
 PostgreSQL 12.9 on x86_64-pc-linux-gnu, compiled by x86_64-pc-linux-gnu-
 gcc (GCC) 7.4.0, 64-bit
 POSTGIS="3.1.5 0" [EXTENSION] PGSQL="120" GEOS="3.8.2-CAPI-1.13.4"
 PROJ="6.2.1" LIBXML="2.9.9" LIBJSON="0.12.99" LIBPROTOBUF="1.3.0"
 WAGYU="0.5.0 (Internal)"

 ERROR:  transform: generic error of unknown origin (-61)
 }}}

 3. Running this Docker image: `postgis/postgis:14-3.2-alpine`
 {{{
 PostgreSQL 14.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine
 11.2.1_git20220219) 11.2.1 20220219, 64-bit
 POSTGIS="3.2.1 0" [EXTENSION] PGSQL="140" GEOS="3.10.2-CAPI-1.16.0"
 PROJ="9.0.0" LIBXML="2.9.14" LIBJSON="0.16" LIBPROTOBUF="1.4.0"
 WAGYU="0.5.0 (Internal)" TOPOLOGY

 ERROR:  transform: Invalid PROJ string syntax (1025)
 }}}

 4. Running this Docker image: `postgis/postgis:15beta2-3.3.0beta1-alpine`
 {{{
 PostgreSQL 15beta2 on x86_64-pc-linux-musl, compiled by gcc (Alpine
 11.2.1_git20220219) 11.2.1 20220219, 64-bit
 POSTGIS="3.3.0beta1 0" [EXTENSION] PGSQL="150" GEOS="3.10.2-CAPI-1.16.0"
 PROJ="9.0.0" LIBXML="2.9.14" LIBJSON="0.16" LIBPROTOBUF="1.4.0"
 WAGYU="0.5.0 (Internal)" TOPOLOGY

 ERROR:  transform: Invalid PROJ string syntax (1025)
 }}}

 If this is fixed, a backport to 3.1.x will be highly appreciated.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5181>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list