-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: ce17d85
- Loading branch information
Showing
3 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
psql -U u1 -h localhost -d db1 >/dev/null <<EOS | ||
$1 | ||
EOS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
sudo su - postgres -- <<EOT | ||
psql <<'SQL' | ||
DROP DATABASE IF EXISTS db1; | ||
DROP DATABASE IF EXISTS db2; | ||
DROP USER IF EXISTS u1; | ||
CREATE USER u1 WITH SUPERUSER PASSWORD 'asdf'; | ||
CREATE DATABASE db1 WITH OWNER = u1 TEMPLATE = template1; | ||
CREATE DATABASE db2 WITH OWNER = u1 TEMPLATE = template1; | ||
SQL | ||
EOT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters