[postgis-tickets] [PostGIS] #4608: Geography GIST index fails on ST_Covers (table named test)

PostGIS trac at osgeo.org
Thu Dec 26 02:51:15 PST 2019


#4608: Geography GIST index fails on ST_Covers (table named test)
----------------------+---------------------------
  Reporter:  jgh      |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  high     |  Milestone:  PostGIS 3.0.1
 Component:  postgis  |    Version:  3.0.x
Resolution:           |   Keywords:
----------------------+---------------------------
Changes (by Algunenano):

 * priority:  low => high
 * milestone:  PostGIS 3.1.0 => PostGIS 3.0.1


Comment:

 Moving this to 3.0.1 since it affects PG12 + Postgis 3.0.

 ST_Covers index function is declared as:
 {{{
         {"st_covers", RTContainsStrategyNumber, 2, 0},
 }}}

 Which is declared as:
 {{{
 #define RTContainsStrategyNumber                7       /* for @> */
 }}}

 Then gist-geometry is declared as:
 {{{
 CREATE OPERATOR CLASS gist_geography_ops
         DEFAULT FOR TYPE geography USING GIST AS
         STORAGE         gidx,
         OPERATOR        3        &&     ,
 --      OPERATOR        6        ~=     ,
 --      OPERATOR        7        ~      ,
 --      OPERATOR        8        @      ,
 }}}

 i.e. no strategy 7 / `operator ~`, hence the error you are seeing.

 By looking at the old (pre PG12) declaration of ST_Covers(geography,
 geography) I see that it was using the `operator &&` instead:
 {{{
 CREATE OR REPLACE FUNCTION ST_Covers(geog1 geography, geog2 geography)
         RETURNS boolean
         AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND
 @extschema at ._ST_Covers($1, $2)'
         LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
 }}}

 So we might need to add a special case for this or have 2 arrays of
 support functions, one for geometry and one for geography. What do you
 think @pramsey?

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