PostgreSQL error when trying to create an extension

后端 未结 15 839

ERROR: could not open extension control file \"/usr/share/postgresql/9.1/extension/postgis.control\": No such file or directory

Is what I get when I tr

相关标签:
15条回答
  • 2020-12-23 20:06

    Try this

    apt-get install postgis
    
    0 讨论(0)
  • 2020-12-23 20:08

    You need to install postgresql-9.1-postgis-scripts. In Ubuntu or Debian, you need to run the following command as root:

    apt-get install postgresql-9.1-postgis-scripts
    

    This adds the files needed to create the postgis extensions.

    0 讨论(0)
  • 2020-12-23 20:12

    Daniel Vérité is close to the truth, but not enough. The package missing is postgresql-9.1-postgis-2.0:

    sudo apt-get install postgresql-9.1-postgis-2.0
    
    0 讨论(0)
  • 2020-12-23 20:14

    Presumably the postgis version you installed is 1.5.x which doesn't come as an extension, but as a couple of SQL scripts that need to be manually applied to create the necessary SQL objects.

    Also the postgis package is not enough, it contains only stuff that doesn't depend on PG version, you need postgresql-9.1-postgis (dpkg -L package-name is handy to check out the files provided by any particular package).

    Once the installation paths are known, the official install documentation should be good enough to set up the template database.

    0 讨论(0)
  • 2020-12-23 20:17

    Just resolved it. You have to uninstall postgis-1.5. You installed it instaed of PostGIS 2.0. As soon as you will install postgis-2.0 you will see corrected libraries in extension directory. Before installing you should to add a correct repository (see http://docs.pgrouting.org/2.0/en/doc/src/installation/index.html#ubuntu-debian). Use ppa:ubuntugis/ubuntugis-unstable for PostGIS 2.0. Try one of

    apt-get remove postgis
    apt-get remove postgresql-9.1-postgis
    apt-get install postgresql-9.1-postgis
    

    I couldn't remove and install because of dependencies error. After a few attmpts, I just removed postgresql-9.1-postgis and apt-get offer me upgrade it to 2.0.

    0 讨论(0)
  • 2020-12-23 20:18

    Make sure that you have installed this

    sudo apt-get install postgresql-9.3-postgis
    

    I was facing same issue due to missing this package.

    0 讨论(0)
提交回复
热议问题