[Dive4elements-commits] [PATCH 2 of 3] merge

Wald Commits scm-commit at wald.intevation.org
Thu Mar 14 12:44:15 CET 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1363260622 -3600
# Node ID 3dc4c27982121871cbf1e42de28d043b19a94c7b
# Parent  66d9389c80cb4256a2775786db4c55f842161d26
# Parent  f6478773a5bb2c8f87932a55aa6c910d331e977f
merge

diff -r 66d9389c80cb -r 3dc4c2798212 flys-backend/doc/schema/postgresql-setup.sh
--- a/flys-backend/doc/schema/postgresql-setup.sh	Thu Mar 14 12:16:58 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-setup.sh	Thu Mar 14 12:30:22 2013 +0100
@@ -1,6 +1,8 @@
 #!/bin/bash
-# $1: user name for new DB
+
+# $1: user name and password for new DB (equals DB name)
 # $2: path to directory with schema-scripts
+# $3: host
 
 # run as user postgres (postgresql super-user)
 # it is assumed that the owner of the DB has the same name as the DB!
@@ -9,9 +11,10 @@
 createuser -S -D -R $1
 createdb $1
 createlang plpgsql $1
-psql -d $1 -f /usr/share/postgresql/contrib/postgis-1.5/postgis.sql
-psql -d $1 -f /usr/share/postgresql/contrib/postgis-1.5/spatial_ref_sys.sql
-psql -d $1 -c "ALTER USER $1 PASSWORD $1;"
+# Appears e.g. as /usr/share/postgresql/contrib/postgis-1.5/ on other systems.
+psql -d $1 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
+psql -d $1 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
+psql -d $1 -c "ALTER USER $1 WITH PASSWORD '$1';"
 psql -d $1 -c "GRANT ALL ON geometry_columns TO $1; GRANT ALL ON geography_columns TO $1; GRANT ALL ON spatial_ref_sys TO $1;"
 
 # add credentials to .pgpass (or create .pgpass)
@@ -19,6 +22,6 @@
 chmod 0600 ~/.pgpass
 
 # apply schema-scripts
-psql -d $1 -U $1 -h $HOST -f $2/postgresql.sql
-psql -d $1 -U $1 -h $HOST -f $2/postgresql-spatial.sql
-psql -d $1 -U $1 -h $HOST -f $2/postgresql-minfo.sql
+psql -d $1 -U $1 -h $3 -f $2/postgresql.sql
+psql -d $1 -U $1 -h $3 -f $2/postgresql-spatial.sql
+psql -d $1 -U $1 -h $3 -f $2/postgresql-minfo.sql


More information about the Dive4elements-commits mailing list