'ERROR: could not access file "$libdir/postgis-2.5": No such file or directory' Dealing with PostGIS has been a nightmare from day one. Every single time I have to touch it in any way, or update PostgreSQL, it turns into a broken mess. The only reason I use it is because I need to be able to use "geography" columns and a few "st_" functions.

Until a few days ago, I had EnterpriseDB's PostgreSQL 11.5 installed on Windows 10. It had PostGIS installed.
Then I installed EnterpriseDB's PostgreSQL 11.7 to update it. Now it somehow lost PostGIS, so I re-installed that as well. Everything has to be done manually for some reason.

Now, every query related to PostGIS gives this error:

ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory


Even when I try to run:

ALTER EXTENSION postgis UPDATE;


I just get this nonsense:

WARNING:  unpackaging raster
WARNING:  PostGIS Raster functionality has been unpackaged
HINT:  type `SELECT postgis_extensions_upgrade(); to finish the upgrade. After upgrading, if you want to drop raster, run: DROP EXTENSION postgis_raster;

ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT:  PL/pgSQL function _postgis_drop_function_if_needed(text,text) line 6 at FOR over SELECT rows
SQL state: 58P01


I don't know why it says 2.5 when I installed postgis-bundle-pg11x64-setup-3.0.1-2.exe.

This doesn't work at all (doesn't exist):

SELECT postgis_extensions_upgrade();


What am I supposed to do?

I've seriously spent so much of my life just fighting with PostGIS that I truly hate it, and wish I could get rid of it forever. Or that they at least could get their act together and integrate it correctly into PostgreSQL so it doesn't lead to all these stupid problems all the time. I don't understand why it has to require so much manual work and fiddling. Why can't it just do these steps automatically?
This was "solved" by installing the 2.5 branch of PostGIS. But everything I said still stands.