我正在尝试在Ubuntu(VPS)中使用PostgreSql 9.3,Postgis 2.1.3和Pgrouting 2.0.0版本。我已经安装了PostgreSql 9.3,但是当我在PgAdmin3中运行CREATE EXTENSION postgis SCHEMA public VERSION "2.0.0";
时,我得到错误:无法使用stat文件“/usr/share/postgresql/9.3/extension/postgis--2.1.3.sql”:没有这样的文件或目录与Pgrouting 2.0.0相同的错误。这些版本的兼容性在该系统中运行吗?,在localhost工作正常。
答案 0 :(得分:1)
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-9.3-postgis-2.1 postgresql-9.3-postgis-scripts postgresql-contrib-9.3 postgresql-client-common postgresql-common postgresql-server-dev-9.3 postgresql-client-9.3
这应该安装所有内容并启动服务器。阅读以下手册页。创建用户和数据库。
man createuser
man createdb
这会将postgis安装到用户'user'的数据库'mydatabase'中:
psql -U user mydatabase -c "create extension postgis"