packages='postgresql postgis postgresql-8.4-postgis'
sudo apt-get install $packages
Настроить /etc/postgresql/8.4/main/pg_hba.conf
Подключиться к сервреу БД
sudo su postgres
psql
Создать пользователя example_user
CREATE ROLE example_user
WITH
CREATEDB
LOGIN
PASSWORD 'qwerty';
CREATE DATABASE example_db;
GRANT ALL PRIVILEGES
ON DATABASE example_db
TO example_user
WITH GRANT OPTION;
ALTER DATABASE example_db OWNER TO example_user;
\q
Проверить что пользователь может соединиться с БД
psql -U example_user -W -d example_db
Установить PostGis в бд example_db
scripts="postgis.sql spatial_ref_sys.sql postgis_comments.sql"
for script in $scripts; do
psql -U example_user -W -d example_db -f /usr/share/postgresql/8.4/contrib/$script
done;