[postgis-devel] [PostGIS] #269: Geometry -> Geography autocast causes && operator query to fail

PostGIS trac at osgeo.org
Thu Oct 15 07:21:43 PDT 2009


#269: Geometry -> Geography autocast causes && operator query to fail
-----------------------+----------------------------------------------------
  Reporter:  mcayland  |       Owner:  pramsey      
      Type:  defect    |      Status:  closed       
  Priority:  medium    |   Milestone:  postgis 1.5.0
 Component:  postgis   |     Version:               
Resolution:  invalid   |    Keywords:               
-----------------------+----------------------------------------------------
Comment (by mcayland):

 Oh - I totally agree that geometry && geography is a no-no, but the error
 message being returned is effectively a developer's error saying "Don't do
 that". Abusing the implicit cast system in this way to enable things to
 get this far is just plain wrong, and will cause confusion to users as to
 exactly which functions have been tested in a geography context and which
 haven't. With the cast removed, I get the following message which is a lot
 more sensible:


 trunk=# explain analyze select count(*) from cities where the_geog &&
 ST_SetSRID(ST_GeographyFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'),
 4326);

 ERROR:  function st_setsrid(geography, integer) does not exist


 I'd like to propose that we remove the implict cast and replace it with an
 explicit cast instead. Then if users want to try functions that haven't
 been tested with geography, then at least they will be made aware they are
 trying something non-standard and can face the relevant consequences.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/269#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list