PostGIS releases a new minor version of PostGIS every one or two years. Each minor version of postgis has a different libname suffix.
In PostGIS 2.1 you'll find files in your PostgreSQL lib folder called postgis-2.1.*, rtpostgis-2.1.*, postgis-topology-2.1.*, address-standardizer-2.1.* etc.
and in a PostGIS 2.2 you'll find similar files but with 2.2 in the name. I believe PostGIS and pgRouting are the only extensions that stamp the lib with a version number.
Most other extensions you will find are just called extension.so e.g. hstore is always called hstore.dll /hstore.so even if the version changed from 9.6 to 10.
On the bright side this allows people to have two versions of PostGIS installed in a PostgreSQL cluster, though a database can use at most one version.
So you can have an experimental database running a very new or unreleased version of PostGIS and a production database running a more battery tested version.
On the sad side this causes a lot of PostGIS users frustration trying to use pg_upgrade to upgrade from an older version of PostGIS/PostgreSQL to a newer version of PostGIS/PostgreSQL;
as their pg_upgrade often bails with a message in the loaded_libraries.txt log file something to the affect:
could not load library "$libdir/postgis-2.2": ERROR: could not access file "$libdir/postgis-2.2": No such file or directory
could not load library "$libdir/postgis-2.3": ERROR: could not access file "$libdir/postgis-2.3": No such file or directory
This is also a hassle because we generally don't support a newer version of PostgreSQL on older PostGIS installs because the PostgreSQL major version changes tend to break our code
often and backporting those changes is both time-consuming and dangerous. For example the DatumGetJsonb change
and this PostgreSQL 11 crasher we haven't isolated the cause of yet. There are several changes like this that have already made the PostGIS 2.4.0
we released recently incompatible with the PostgreSQL 11 head development.
Continue reading "Using pg_upgrade to upgrade PostGIS without installing an older version of PostGIS"