[postgis-tickets] [PostGIS] #2262: autocast to box causing issues with removed functions

PostGIS trac at osgeo.org
Fri Apr 26 18:22:04 PDT 2013


#2262: autocast to box causing issues with removed functions
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.1.0
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------
Changes (by robe):

  * milestone:  PostGIS 2.0.4 => PostGIS 2.1.0


Comment:

 I forgot about the more obvious solution though I guess we can't do it
 until 2.1 since its an API change.  Can simply change this cast from
 IMPLICIT to assignment?

 So if we do this:


 {{{
 CREATE CAST (geometry AS box) WITH FUNCTION box(geometry) AS IMPLICIT;

 }}}

 to

 {{{
 CREATE CAST (geometry AS box) WITH FUNCTION box(geometry) AS ASSIGNMENT;

 }}}

 I experimented with dropping it and as far as I can tell the earth did not
 shatter (it let me drop without complaining it needed to drop anything)

 It might break some people's code, but it was problem breaking people's
 code already in the worst possible way: LOGICAL.


 Once I made that change on my db, then this:


 {{{
 SELECT area('POINT(1 2)'::geometry)
 }}}
 was no longer legal and gave the correct


 {{{
 ERROR:  function area(geometry) does not exist
 LINE 1: SELECT area('POINT(1 2)'::geometry)
 }}}

 Of course this means putting in


 {{{
 ALTER EXTENSION postgis DROP CAST (geometry AS box);  -- only needed for
 extension
 DROP CAST (geometry AS box);
 CREATE CAST (geometry AS box) WITH FUNCTION public.box(geometry) AS
 ASSIGNMENT;

 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2262#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