Opened 9 years ago

Last modified 15 months ago

#3373 new enhancement

ALTER DOMAIN missing from topology_upgrade — at Version 3

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS Fund Me
Component: topology Version: master
Keywords: upgrade Cc:

Description (last modified by strk)

I just noticed that the ALTER DOMAIN statements in topology.sql.in (meant to do upgrades) are not being present in the topology_upgrade.sql script, meaning domain constraints are not properly upgraded.

Changing to an enhancement request.

Change History (3)

comment:1 by strk, 9 years ago

I see ALTER lines are explicitly removed from the SQL file for the purpose of creating the upgrade script, but dont' understand why. Digging back in history I found r8157 being the commit that introduced the rule to create the upgrade script, by Regina in November 2011.

Regina, where did you copy that from ? Why an ALTER is also condidered something that cannot be present in an upgrade ? The comment above that snippet says:

+#Generate upgrade script by stripping things that can't be reinstalled
+#e.g. don't bother with tables, types, triggers, and domains

comment:2 by strk, 9 years ago

Ok one reason to strip the ALTER is that some of the ALTERs in there are for adding constraints, and fail if the constraint already exists. I guess the topology script could be changed to account for that, or otherwise it would be impossible for an upgrade to add or drop a constraint…

DROP .. IF EXISTS .. is only available starting with PostgreSQL 9.2 though

comment:3 by strk, 9 years ago

Description: modified (diff)
Milestone: PostGIS 2.2.1PostGIS 2.3.0
Type: defectenhancement
Version: 2.2.xtrunk

I guess it is time to generate the topology upgrade via our postgis_proc_upgrade.pl, and add there logic to handle changes in constraints set attached to domains.

Note: See TracTickets for help on using tickets.