[postgis-tickets] [PostGIS] #2529: LWGEOM API for read-only PointArrays is not enforced

PostGIS trac at osgeo.org
Wed Nov 6 01:54:46 PST 2013


#2529: LWGEOM API for read-only PointArrays is not enforced
---------------------------------+------------------------------------------
  Reporter:  marcelosoaressouza  |       Owner:  pramsey                                
      Type:  defect              |      Status:  reopened                               
  Priority:  medium              |   Milestone:  PostGIS 2.2.0                          
 Component:  postgis             |     Version:  trunk                                  
Resolution:                      |    Keywords:  ST_FlipCoordinates, PostGIS, PostgreSQL
---------------------------------+------------------------------------------

Comment(by strk):

 About always copying I made an effort in the past to avoid that, for
 performance reasons.
 Probably not a big deal today to make more copies, but is that really
 needed ?

 The lilwgeom header should document which versions write to underlying
 pointarray and which not, and the caller should pay attention to that. The
 liblwgeom API includes functions to clone geometries when that's the
 desired behavior. For example a caller from PostGIS may clone only if
 PG_DETOAST_DATUM didn't give it a copy already (like PG_FREE_IF_COPY).

 If we want to add more "security triggers" we should make the flag capable
 of expressing more states, like 2 different bits for read/write and owned
 /to-be-freed

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