[Lada-commits] [PATCH] Add script to set up database as user postgres

Wald Commits scm-commit at wald.intevation.org
Mon Oct 26 15:48:04 CET 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1445870871 -3600
# Node ID 17165e710631812047eacae377adc81d9e0fa0ff
# Parent  c998673c6d1ef49e96d64f85af495704dfea9123
Add script to set up database as user postgres.

diff -r c998673c6d1e -r 17165e710631 db_schema/setup-db.sh
--- /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;"


More information about the Lada-commits mailing list