Ticket #223 (closed defect: worksforme)

Opened 4 years ago

Last modified 2 years ago

Breaking change ST_Extent returns a box3d_extent object

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.4.1
Component: postgis Version:
Keywords: boxes Cc:

Description

I've been testing 1.4 on some production apps for the past couple of days and ran into one breaking change.

Since our ST_Extent now returns a box3d_extent, this broke one of my custom functions that was expecting a box2d

To fix, I had to make a change to my app to accept box3d instead of box2d in the function call, but I also had to put in an auto cast

CREATE CAST (box3d_extent AS box3d)

WITH FUNCTION st_box3d_extent(box3d_extent) AS IMPLICIT;

While this is not a bug, it is something that is likely to break some applications. So I presume we should make note of it in the release notes.

Change History

Changed 4 years ago by robe

On closer inspection, there are two things going on here. I think our postgis_upgrade.sql is missing casts for box3d_extent. I had two versions of this database. One I restored on top of a fresh 1.4 vanilla db and one I upgraded with the upgrade script. I think its the one I upgraded that was missing the auto cast. Though hmm I think the other one is giving a

ERROR: function get_coords(box3d_extent) is not unique LINE 6: get_coords(ST_Extent(the_geom)) As acoord

(because I have one function for geometry and one for box2d to handle the extent.) In that on. So I had to delete my box2d one and create nothing or create a box3d_extent. Resulting in very sluggish performance (though that may be unrelated) Still need to investigate why its no longer using an index.

I guess I'll have to retrace my steps on this one to figure out if this is just an isolated issue on my database.

Changed 4 years ago by pramsey

  • milestone changed from postgis 1.4.0 to postgis 1.4.1

Changed 4 years ago by pramsey

  • status changed from new to closed
  • resolution set to worksforme

I'm not seeing this, and I am seeing the appropriate cast in the postgis.sql file.

Changed 4 years ago by robe

But its missing in the upgrade script. Well the upgrade script needs a bit of work I suppose anyway.

Try this for size on your virgin PostGIS 1.4/1.5 install to see what I mean? Does it work for you? This works in 1.3

SELECT ST_Box3d(ST_Extent('POINT(1 2)'::geometry))

I don't think there is much we can do about it and not sure how badly it affects people - so thought we should just note it. It broke one of my apps is all.

Changed 2 years ago by strk

See ticket #1001 for other effects of this.

Changed 2 years ago by strk

  • keywords boxes added
Note: See TracTickets for help on using tickets.