Hello,
I’m trying to upgrade my PostgreSQL database from 9.6 to 10, but the Postgis extension is blocking me.
I tried the managed migration but I got an error caused by the Postgis extension:
"pre-upgrade check failed: errors:{type:INVALID_EXTENSION_VERSION detail:“extension "postgis" needs to be upgraded before major version upgrade for database”
Then I tried to manually upgrade Postgis but I got this error:

After looking on the internet, I found a few people with the same issue and no clear answer (except contact support). Actually, the only user that can have the right to do the update of the extension is the “cloudsqladmin”, which is only available for Google’s internals uses.
The official Google page for database upgrade says to perform self-service maintenance , but the documentation is unclear, and when I run the “gcloud sql instances describe data-base-ID” command, I get no “availableMaintenanceVersions”.
Even logging in as the owner of the database with the “cloudsqlsuperuser” doesn’t resolve the permissions issues.
I also tried to manually drop the Postgis extension but I got the same error as before (must be owner of the extension).
My case is very similar to this post, but there is no clear solution to the issue in this thread.
Is there anyone that can help ?
Thanks in advance !