comparison backend/doc/schema/postgresql-setup.sh @ 6818:4ad2b530dbba double-precision

Make postgresql-setup helper script work on different platforms.
author Tom Gottfried <tom@intevation.de>
date Mon, 12 Aug 2013 18:14:12 +0200
parents 5aa05a7a34b7
children c1cea6c95967
comparison
equal deleted inserted replaced
6817:63a24b4fbebf 6818:4ad2b530dbba
9 9
10 # create PostGIS-DB 10 # create PostGIS-DB
11 createuser -S -D -R $1 11 createuser -S -D -R $1
12 createdb $1 12 createdb $1
13 createlang plpgsql $1 13 createlang plpgsql $1
14 # Appears e.g. as /usr/share/postgresql/contrib/postgis-1.5/ on other systems. 14 # Path appears e.g. as /usr/share/postgresql/contrib/postgis-1.5/ on some systems,
15 psql -d $1 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql 15 # /usr/share/postgresql/8.4/contrib/postgis-1.5/ on others
16 psql -d $1 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql 16 POST_INIT_DIR=`find /usr/share/postgresql/ -name spatial_ref_sys.sql | sed -n '1p'`
17 POST_INIT_DIR=`dirname $POST_INIT_DIR`
18 psql -d $1 -f $POST_INIT_DIR/postgis.sql
19 psql -d $1 -f $POST_INIT_DIR/spatial_ref_sys.sql
17 psql -d $1 -c "ALTER USER $1 WITH PASSWORD '$1';" 20 psql -d $1 -c "ALTER USER $1 WITH PASSWORD '$1';"
18 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;" 21 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;"
19 22
20 # add credentials to .pgpass (or create .pgpass) 23 # add credentials to .pgpass (or create .pgpass)
21 echo "*:*:$1:$1:$1" >> ~/.pgpass 24 echo "*:*:$1:$1:$1" >> ~/.pgpass

http://dive4elements.wald.intevation.org