Files
zulip/tools/postgres-init-db
Leo Franchi 0df3d5f2aa Give create db permissions to humbug postgres user
(imported from commit 85775d1885efcd8790593e6841ce9d56f027eea7)
2013-03-12 12:51:12 -04:00

18 lines
339 B
Plaintext
Executable File

#/bin/sh -xe
PASSWORD=xxxxxxxxxxxx
sudo -u postgres psql << EOF
DROP SCHEMA public CASCADE;
CREATE DATABASE humbug;
CREATE USER humbug WITH PASSWORD '$PASSWORD';
GRANT ALL ON DATABASE humbug TO humbug;
ALTER USER humbug CREATEDB;
EOF
echo "Database created"
umask go-rw
echo "*:*:*:humbug:$PASSWORD" >> ~/.pgpass
chmod go-rw ~/.pgpass