[postgis-devel] [PostGIS] #202: upgrade issues

PostGIS trac at osgeo.org
Thu Aug 13 05:36:06 PDT 2009


#202: upgrade issues
----------------------+-----------------------------------------------------
  Reporter:  robe     |       Owner:  robe         
      Type:  defect   |      Status:  assigned     
  Priority:  medium   |   Milestone:  postgis 1.4.1
 Component:  postgis  |     Version:  trunk        
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------
Changes (by robe):

  * owner:  pramsey => robe
  * status:  new => assigned

Comment:

 Now that I've been experimenting with upgrading one of my 1.4 databases to
 1.5 and next 1.3 to 1.5 and of course the CREATE TYPES are getting
 in the way of using the postgis_upgrade.sql without editing.  I have come
 up with a possibly  hair-brained idea along the ideas of creating a temp
 plpgsql function we discussed.

 Seems our upgrade problems are mostly caused by CREATE TYPE and CREATE
 CASTS, the fact that we don't have a CREATE IF NOT EXISTS (until
 PostgreSQL 8.5).
 The other issue which maybe is caused because of this, is why we even need
 a postgis upgrade.sql to begin with.

 My thought -- create a plpgsql function -- which I'm fussing with at the
 moment.  That compartmentalizes all our CREATE TYPE, CREATE CASTS (some
 stuff that may have a drop we may not want to if its used in views and we
 don't want the upgrade to fail because of it)
 stuff that takes two arguments --> object_type, type name.

 We create this function first as part of postgis.in.sql.c  and plop in all
 our CREATE TYPE ....
 wrapped with IF conditions that check the pg_catalog for the existence of
 these things and if they are used etc..

 Then where we currently have

 CREATE TYPE something -- we replace with
 SELECT postgis_create('TYPE', 'something');

 And if Mark is bothered with having this function around -- and also the
 fact that it would be introducing a function
 to PostGIS so we can't back port it (unless it doesn't exist when we are
 done), we can simply drop it at the end of the postgis.sql.

 So in short.  We have just one postgis.sql (no soft upgrade anything).
 Our Soft Upgrade instructions are simply to say
 rerun postgis.sql or if you are coming from a really old version of
 PostGIS you have to do a dump restore.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/202#comment:18>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list