comparison db_schema/setup-db.sh @ 742:17165e710631

Add script to set up database as user postgres.
author Tom Gottfried <tom@intevation.de>
date Mon, 26 Oct 2015 15:47:51 +0100
parents
children 0cf9387c8da2
comparison
equal deleted inserted replaced
741:c998673c6d1e 742:17165e710631
1 #!/bin/sh
2 DIR=`dirname $0`
3
4 ROLE_NAME=lada
5 ROLE_PW=lada
6 DB_NAME=lada
7
8 psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
9 createdb -E UTF-8 $DB_NAME
10 psql -d $DB_NAME -f $DIR/lada_schema.sql
11 psql -d $DB_NAME --command \
12 "GRANT USAGE ON SCHEMA stammdaten, bund, land TO $ROLE_NAME;
13 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES
14 ON ALL TABLES IN SCHEMA stammdaten, bund, land TO $ROLE_NAME;"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)