Fix handling -D parameter

This commit is contained in:
Benjamin Renard 2019-03-15 16:26:05 +01:00
parent 40ecc78570
commit a33e0bfabc

View file

@ -112,7 +112,7 @@ id "$PG_USER" > /dev/null 2>&1
[ $( echo "$PG_DEFAULT_PORT"|grep -c -E '^[0-9]*$' ) -ne 1 ] && "UNKNOWN : Postgres default master TCP port must be an integer." && exit 3
# If PG_DB is not provided with -D parameter, use PG_USER as default value
[ -z "$PB_DB" ] && PG_DB="$PG_USER"
[ -z "$PG_DB" ] && PG_DB="$PG_USER"
function psql_get () {
echo "$1"|su - $PG_USER -c "$PSQL_BIN -d "$PG_DB" -t -P format=unaligned"