我和我的团队正在经历的维护阶段,目前,我一直忙于升级的一切。 上周,我从移动PostgreSQL的9.1至9.3和1.5的PostGIS团队2.1所有顺利。 昨日,Rails的团队提交了我们的CI迅速拒绝了轨道4升级pull请求。 任何建议将不胜感激。
当试图创建一个新的测试数据库,我收到以下错误的Rails:
PG::RaiseException: ERROR: PostGIS is already installed in schema 'public', uninstall it first : CREATE EXTENSION postgis SCHEMA public
一些规格:
- Debian的7喘息
- PostgreSQL的9.3
- PostGIS的2.1
- 红宝石2.1.0
- 轨道4
我的PostgreSQL / PostGIS的安装步骤:
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
apt-get update -y
apt-get install postgresql-9.3-postgis-2.1
sudo -u postgres psql -c "CREATE USER xxadmin WITH PASSWORD 'xxpass';"
sudo -u postgres psql -c "ALTER USER xxadmin WITH SUPERUSER;"
sudo -u postgres psql -c "create database template_postgis with template = template1;"
sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';"
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.3/extension/postgis--2.1.2.sql
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geometry_columns TO xxadmin;"
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO xxadmin;"
sudo -u postgres psql -d template_postgis -c "VACUUM FREEZE;"
sudo -u postgres psql -c "ALTER DATABASE template_postgis OWNER TO xxadmin;"
sudo -u postgres psql -d template_postgis -c "ALTER VIEW geography_columns OWNER to xxadmin;"
sudo -u postgres psql -d template_postgis -c "ALTER TABLE geometry_columns OWNER to xxadmin;"
sudo -u postgres psql -d template_postgis -c "ALTER TABLE spatial_ref_sys OWNER to xxadmin;"