Mercurial > dive4elements > river
view backend/doc/schema/postgresql-setup.sh @ 6048:caf9d989bd84
Fix waterlevel classes and change defaults for them.
If to is 0 then we create a class that goes to 9999
If step is 0 then we only have a single step >= 0
The defaults are now from 0, to 2m with a step of 0.5
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 17 May 2013 17:56:20 +0200 |
parents | 5aa05a7a34b7 |
children | 4ad2b530dbba |
line wrap: on
line source
#!/bin/bash # $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! # create PostGIS-DB createuser -S -D -R $1 createdb $1 createlang plpgsql $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) echo "*:*:$1:$1:$1" >> ~/.pgpass chmod 0600 ~/.pgpass # apply schema-scripts 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