Skip to content

Commit

Permalink
wip -- dbg pg app client usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ransomw1c committed Sep 26, 2019
1 parent f5e9dca commit 776fc54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hack/fuse-demo/mock_application_pg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ PG_SU=postgres
PG_U=testpguser
PG_DB=testdb

# aside: postgres defaults to UNIX (filesystem) socket at /var/run/postgresql/*,
# not IP (network) socket, so it's the client's responsibility to ensure that
# the conn is opened at the network location

print -- "CREATE ROLE ${PG_U} WITH LOGIN CREATEDB;
CREATE DATABASE ${PG_DB} WITH OWNER ${PG_U};" | \
psql -p $MY_PG_PORT -U $PG_SU
psql -h localhost -p $MY_PG_PORT -U $PG_SU


run_sql() {
print -- "$1" | psql -p $MY_PG_PORT -U ${PG_U} ${PG_DB}
print -- "$1" | psql -h localhost -p $MY_PG_PORT -U ${PG_U} ${PG_DB}
}

run_sql 'CREATE TABLE tabla_e (
Expand Down

0 comments on commit 776fc54

Please sign in to comment.