changeset 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 c998673c6d1e
children c7fcc46c6a57
files db_schema/setup-db.sh
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/db_schema/setup-db.sh	Mon Oct 26 15:47:51 2015 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+DIR=`dirname $0`
+
+ROLE_NAME=lada
+ROLE_PW=lada
+DB_NAME=lada
+
+psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
+createdb -E UTF-8 $DB_NAME
+psql -d $DB_NAME -f $DIR/lada_schema.sql
+psql -d $DB_NAME --command \
+     "GRANT USAGE ON SCHEMA stammdaten, bund, land TO $ROLE_NAME;
+      GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES
+            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)