Opened 12 years ago

Closed 12 years ago

#1945 closed defect (fixed)

[raster] Upgrade scripts fail with addbandarg does not exist and other things

Reported by: robe Owned by: robe
Priority: medium Milestone: PostGIS 2.1.0
Component: raster Version: 2.0.x
Keywords: Cc:

Description

The new additions to raster make it impossible to upgrade from an earlier 2.1.0SVN or 2.0… to present.

Get addbandarg[] does not exist if you are coming from lower 2.1.0SVN.

These new ones need to be added to rtpostgis_upgrade_cleanup.sql.in.c

I think we can safely get rid of 8.4 logic since 9.0 is our minimal now. So I'm going to wipe that out too.

Change History (10)

comment:1 by dustymugs, 12 years ago

Added addbandarg and agg_samealignment TYPEs to rtpostgis_upgrade_cleanup.sql.in.c in r10157

comment:2 by robe, 12 years ago

That seems to fix my issues, though I don't like the CASCADE since if someone happens to use these types in their own functions, there functions will be destroyed as well.

comment:3 by dustymugs, 12 years ago

Neither do I. I'm writing some code to minimize the impact…

comment:4 by dustymugs, 12 years ago

I've added some logic in r10161 to only DROP and/or CREATE if need be.

comment:5 by dustymugs, 12 years ago

Ignore my last. r10162 should work better as it tries not to be as destructive.

comment:6 by robe, 12 years ago

Is their a reason you chose to rename addbandarg instead of just dropping it?

The problem is if I'm coming from 2.0.1, I don't have an addbandarg to rename so it fails.

comment:7 by dustymugs, 12 years ago

I tried to find a solution that removes the CASCADE. Renaming the datatype allows us to continue the upgrade while not touching user code that uses the datatype. Granted, I think the statement a few lines later attempting to drop renamed datatype will also fail if there is user code. Alright, I'll keep things stupidly simple.

comment:8 by dustymugs, 12 years ago

Fixed in r10169.

comment:9 by robe, 12 years ago

Still doesn't work I'm afraid. I think we'll have to put these in a loop to create in the DO like I did with the box3d raster cast. or go back to your CASCADE

The issue is you can't even check if those functions exist since they reference non-existent types. So it breaks in the DROP IF EXISTS.

I'm going to get rid of the 8.4 section since we won't be supporting 8.4 in 2.1. eventually it would be nice to just have this DO section where you create the type, so we don't have to state the CREATE twice but I think the way strk's perl script is written, it would wipe it out. So I'll deal with that some other day.

comment:10 by robe, 12 years ago

Resolution: fixed
Status: newclosed

fixed in r10170. Feel free to reopen if you are not satisfied with my change.

I tested on my 9.1 instance upgrading from 2.0.1 to current 2.1.0 both the old fashioned way and using extensions. It should work fine on 9.0 since DO is supported in 9.0. I also got rid of the 8.4 legacy code.

Note: See TracTickets for help on using tickets.