[postgis-tickets] [PostGIS] #2242: ST_Union in aggregate form treats NULL as EMPTY

PostGIS trac at osgeo.org
Mon May 6 09:47:00 PDT 2013


#2242: ST_Union in aggregate form treats NULL as EMPTY
------------------------+---------------------------------------------------
 Reporter:  gabrimonfa  |       Owner:  pramsey
     Type:  defect      |      Status:  new    
 Priority:  medium      |   Milestone:         
Component:  postgis     |     Version:  2.0.x  
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by nw):

 Aggregates generally ignore nulls where they wouldn't really
 be meaningful, or keep as a null if that makes sense.
 I would be surprised if ST_Union returned null if one of the
 inputs was null.

 select string_agg(i,', ') from (select generate_series(1,3)::text as i
 union all select null union all  select generate_series(1,3)::text as i)
 as i;
     string_agg
 ------------------
  1, 2, 3, 1, 2, 3
 (1 row)

 I think treating null as empty is the right thing to do here.

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