title: PostgreSQL upgrade on Amazon RDS blocked by PostGIS version
body: <p>I'm trying to upgrade my RDS instance from 9.5.4 to 9.6.1, and I'm getting blocked by an error about the PostGIS version needing to be upgraded first.</p>
  
  <blockquote>
    <p>Database instance is in a state that cannot be upgraded: PreUpgrade checks failed: The instance could not be upgraded because there are one or more databases with an older version of PostGIS installed. Please upgrade all installations of PostGIS and try again.</p>
  </blockquote>
  
  <p>The highest version of PostGIS supported by RDS 9.5.4 is 2.2.2</p>
  
  <blockquote>
    <p>alter extension postgis update</p>
  </blockquote>
  
  <p>yields</p>
  
  <blockquote>
    <p>NOTICE:  version "2.2.2" of extension "postgis" is already installed</p>
  </blockquote>
  
  <p>I tried upgrading explicitly to the version in 9.6.1</p>
  
  <blockquote>
    <p>alter extension postgis update to '2.3.0'</p>
  </blockquote>
  
  <p>Getting</p>
  
  <blockquote>
    <p>[Err] ERROR:  extension "postgis" has no update path from version "2.2.2" to version "2.3.0"</p>
  </blockquote>
  
  <p>So my question is: how do I upgrade?  I suspect I can delete the extension prior to the upgrade and install the new version after, but I don't know what that will do to my data, or if that will properly upgrade my spatial structures or functions.</p>
  
  <p>I have already checked the <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html" rel="noreferrer">documentation</a> for any mention of this scenario </p>