[postgis-tickets] [PostGIS] #4590: Upgrading PostGIS 3.0 PG 11 to PostGIS 3.0 PG 12 errors after pg_upgrade - st_linecrossingdirection

PostGIS trac at osgeo.org
Sat Nov 23 09:20:32 PST 2019


#4590: Upgrading PostGIS 3.0 PG 11 to PostGIS 3.0 PG 12 errors after pg_upgrade -
st_linecrossingdirection
------------------------------------+---------------------------
  Reporter:  robe                   |      Owner:  strk
      Type:  defect                 |     Status:  new
  Priority:  medium                 |  Milestone:  PostGIS 3.0.1
 Component:  build/upgrade/install  |    Version:  3.0.x
Resolution:                         |   Keywords:
------------------------------------+---------------------------

Comment (by Algunenano):

 There is an issue with the ifdef PG11. For PG11 and before it currently
 has line1 and line2 as parameters, while for PG12 it has geom1 and geom2.


 PG11:
 {{{
 CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(line1 geometry, line2
 geometry)
         RETURNS integer AS
         $$ SELECT CASE WHEN NOT $1 OPERATOR(@extschema at .&&) $2 THEN 0 ELSE
 @extschema at ._ST_LineCrossingDirection($1,$2) END $$
         LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
 }}}

 PG12:
 {{{
 CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(geom1 geometry, geom2
 geometry)
         RETURNS integer
         AS 'MODULE_PATHNAME', 'ST_LineCrossingDirection'
         SUPPORT postgis_index_supportfn
         LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
         _COST_HIGH;
 }}}


 The comment in `postgis_before_upgrade.sql` says:
 {{{
 -- FUNCTION ST_LineCrossingDirection changed argument names in 3.0
 -- Was (geom1 geometry, geom2 geometry) and now (line1 geometry, line2
 geometry)
 SELECT _postgis_drop_function_if_needed
         (
         'ST_LineCrossingDirection',
         'geom1 geometry, geom2 geometry'
         );

 -- FUNCTION _st_linecrossingdirection changed argument names in 3.0
 -- Was (geom1 geometry, geom2 geometry) and now (line1 geometry, line2
 geometry)
 SELECT _postgis_drop_function_if_needed
         (
         '_ST_LineCrossingDirection',
         'geom1 geometry, geom2 geometry'
         );
 }}}

 So I guess it's an oversight and the PG12 version should also have line1
 and line2 as arguments.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4590#comment:2>
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