postgis_raster is now a separate extension from postgis
Since PostGIS 2.0 the raster functionality has been part of the postgis extension. It has grown so big that it is as big as the postgis geometry, geography vector support.
Some people complained about the extra 300 functions they had to wade thru if they weren't raster users. Since it was part of the postgis extension, it also meant that if you didn't want to compile with raster, then you get no postgis extension either and had to resort to the old-fashioned scripts install.
After much arguing about the best way to settle this and have a smooth upgrade Sandro came up with a plan and the work needed to unravel the raster part of the postgis extension and rebundle it into its own extension.
That said if you are upgrading from a pre-3.0 version of PostGIS you should upgrade as follows:
ALTER EXTENSION postgis UPDATE; --- upgrades and unpackages raster
SELECT PostGIS_Extensions_Upgrade(); -- rebundles raster into postgis_raster
If you have no need for raster, you can follow the above with:
DROP EXTENSION postgis_raster;
Moving forward, especially if you have a lot of PostGIS extensions, instead of updating each one by one, the command (which was introduced in 2.5 and extended in 3.0)
SELECT PostGIS_Extensions_Upgrade();
Will upgrade all the extensions starting with postgis_ for you to the last version installed.
If you are installing PostGIS fresh and only need vector support, it's business as usual, you can do:
CREATE EXTENSION postgis;
For raster users, you can add this line
CREATE EXTENSION postgis_raster;
Or for PostgreSQL 9.6 and above, do it in one step with
CREATE EXTENSION postgis_raster CASCADE;
If you are like us and prefer to have your postgis in a dedicated schema (not in public), be warned, that you MUST install all the postgis extensions in the same schema because they are schema qualified and rely on the postgis extension.
PostGIS minor dropped in lib version
In prior versions of PostGIS, our minor releases when installed would have the minor version in the library file. This made using pg_upgrade a bit tricky for many as described here and here. Starting at PostGIS 3, we decided to drop the minor so instead of the lib file name called postgis-3.0, it is by default called postgis-3.
This means going from 3.0 to 3.1 to 3.2, the lib file name will remain the same, so you don't need to symlink or install the older version in your shiny new PostgreSQL.
You can still get the old behavior with configure switch --with-library-minor-version.
Some people asked why we can't drop the major version number as well. Well that in theory we are saving should we make such a drastic change like a super on-disk format that does require a full dump / reload.