[postgis-users] Private message regarding: soft upgrade 2.0.3 > 2.1.1
Paragon Corporation
lr at pcorp.us
Wed Mar 19 17:58:52 PDT 2014
Jason,
CREATE OR REPLACE is done for the other functions, so you won't have issues
there unless signatures changed, which they didn't.
We have to drop aggregates if they change because PostgreSQL has no CREATE
OR REPLACE AGGREGATE technically because an AGGREGATE is mostly a structure
thing so if the structure changed you'd need to drop and recreate anyway.
We've been lazy in past though and always just dropped and recreated them
so we don't have to keep track of the book keeping of what version they
changed in if they changed. Our assumption was that few people use them in
views so no real harm to most.
strk put his foot down one day when he was sick because he uses them in
views. He had been threatening to put his foot down for a couple of years
and his fever made him brave. No point trying to fight with a feverish man.
Take a bow strk :).
Thanks,
Regina
_____
From: Jason [mailto:jmathis at redzonesoftware.com]
Sent: Wednesday, March 19, 2014 10:32 AM
To: lr at pcorp.us
Subject: Private message regarding: [postgis-users] soft upgrade 2.0.3 >
2.1.1
Awesome thanks Regina!
We will just wait; no rush on our end.
Although I am assuming if some functions have changed and we have referenced
them in views that we will run into the same problem. Why not do a "create
or replace" instead of drop and create?
thanks again for the quick response.
On Tuesday, March 18, 2014 6:23:52 PM UTC-6, Paragon Corporation wrote:
Jason,
You migth want to wait til 2.1.2 is out which hopefully will be in next 2
weeks. It has a couple of important geography fixes and also we changed
upgrade process to not drop aggregates unless absolutely necessary. ST_Union
agg did not change between 2.0 and 2.1 so no need to drop it.
Alternatively you can edit the extension script in share/extension
(postgis-2.0.3--2.1.1.sql)
and remove the following lines from it:
DROP AGGREGATE IF EXISTS ST_Union(geometry);
CREATE AGGREGATE ST_Union (
basetype = geometry,
sfunc = pgis_geometry_accum_transfn,
stype = pgis_abs,
finalfunc = pgis_geometry_union_finalfn
);
Then run as you did:
psql -c "ALTER EXTENSION postgis UPDATE TO '2.1.1';"
after you are done:
run this: (since script drops all aggs from extension as I recall )
ALTER EXTENSION postgis ADD AGGREGATE ST_Union(geometry);
Hope that helps,
Regina
http://www.postgis.us
_____
From: postgis-us... at lists. <javascript:> osgeo.org [mailto:postgis-us...@
<javascript:> lists.osgeo.org] On Behalf Of Jason
Sent: Tuesday, March 18, 2014 5:52 PM
To: postgi... at googlegroups.com <javascript:>
Subject: [postgis-users] soft upgrade 2.0.3 > 2.1.1
Hi All,
OS: centos 6.5
Postgres: 9.2.7
PostGIS: 2.0.3
We have recently finished cleaning up and consolidating apps/servers and
upgraded to postgres 9.2.7. Now that postgres is upgraded we decided to get
postgis upgraded as well; currently we are at 2.0.3. According to postgis
docs we can do the "soft upgrade" path, which sounds wonderful. We used
"create extension" for all our 2.0.3 databases.We are on centos 6.5 and I am
using yum to update the postgis packages. I did a quick test on a vm that
had a empty database and the postgis update went fine. After a little
research I figured it was time to run the process on our dev node. The steps
are:
yum install postgis2_92 #2.1.1
psql -c "ALTER EXTENSION postgis UPDATE TO '2.1.1';"
The yum installed went fine but the "alter extension" failed with:
ERROR: cannot drop function st_union(geometry) because other objects depend
on it
...
It went on to list a few views that used that function. I tried dropping
those views but it just moved on to other views that had postgis functions
in them. Dropping all views is not worth it:)
Does anyone know if soft upgrading from 2.0.3 > 2.1.1 is possible? Could it
be something in our setup that is stopping us from upgrading. Otherwise it
looks like a hard upgrade is in our future, and its hard to get excited
about that.
Thanks!
This transmission contains confidential and privileged information intended
solely for the party identified above. If you receive this message in error,
you must not use it or convey it to others. Please destroy it immediately
and contact the sender at (303) 386-3955 or by return e-mail to the sender.
This transmission contains confidential and privileged information intended
solely for the party identified above. If you receive this message in error,
you must not use it or convey it to others. Please destroy it immediately
and contact the sender at (303) 386-3955 or by return e-mail to the sender.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140319/7d4c85ef/attachment.html>
More information about the postgis-users
mailing list