For some reason I messed up an installation of Postgis on my PostgreSQL 9.2.8 server. I had version 2.0.3 installed and when I tried to upgrade to 2.1 it did so. The problem comes when I dump the database to restore it on another machine. In the dump there is the create extension statement for version 2.1 of postgis but I also get the create statements for all the postgis associated functions.
If I manually remove all of the create function statements from the dump and import the dump in another DB it will work perfectly. What I need to know is how to solve this problem on my current machine.
I have posted on Database Administrators but without success. This is the link to the question.
What I have tried as per suggestions is the following:
create extension postgis from unpackaged but this will throw an error stating that postgis already exists.
alter extension postgis update to '2.1.0' will complete but when i dump the database the create function commands relative to version 2.0.3 are still there.
Dumps of the
select * from pg_available_extensions are on the DB stack exchange question and they clearly show that default_version is 2.0.3 but installed version is 2.1.0
The database is working properly so for it's just a matter of cleaning up this mess that I have created.
Suggestions are highly appreciated!