[postgis-users] hard upgrade from 1.5

Nathan Wagner nw at hydaspes.if.org
Mon Jan 10 10:01:14 PST 2022


I am working on an upgrade from postgis 1.5 on postgresql 9.0 to postgis
2.5 on postgresql 11.

The docs say that a hard upgrade is needed.  Is that still true if we're
migrating the data from one database to another?  Our migration strategy
is to do a copy out of the table data (as in a \copy psql command, or
equivalent) from the source and a copy in at the target.  An examination
of the results seem to indicate that the data is copied correctly.

I had been under the impression that the binary format had changed, but
I am unable to find an example of this.

So, if you're not upgrading in place, but doing a copy, is a "hard" type
upgrade needed?  My earlier strategy had been to select the data out of
the database wrapping the geometry columns in st_asewkt() on the way out
and similarly on the way in.  This doesn't seem like it's needed and I
can just use the binary representation directly.

I had thought that postgis_restore.pl would have done some sort of
wrapper, but I think it just adjusts the manifest list of a pg_restore
-l, which we don't need in our case since we have the new version of
postgis already installed on the new database.

I can't find any mention of a change in the binary format in the git
logs, but if there weren't a binary format change, I would have thought
that a simple 'from unpackaged' script to convert to an extension would
have been sufficient and could have been done in place without needing
anything special.

So, why exactly is a hard upgrade needed from 1.5 to 2.5?

Can I do a copy to file from the 1.5 and then copy from that file to 2.5
and expect it to work?  If not, why not, what sort of errors should I
expect?  A specific example of something that doesn't work would be
ideal, since then I could then write a failing test.

-- 
nw


More information about the postgis-users mailing list