Improve debug mode
This commit is contained in:
parent
a33e0bfabc
commit
99bacd9979
1 changed files with 4 additions and 2 deletions
|
@ -115,13 +115,15 @@ id "$PG_USER" > /dev/null 2>&1
|
||||||
[ -z "$PG_DB" ] && PG_DB="$PG_USER"
|
[ -z "$PG_DB" ] && PG_DB="$PG_USER"
|
||||||
|
|
||||||
function psql_get () {
|
function psql_get () {
|
||||||
echo "$1"|su - $PG_USER -c "$PSQL_BIN -d "$PG_DB" -t -P format=unaligned"
|
sql="$1"
|
||||||
|
debug "Exec 'echo \"$sql\"|su - $PG_USER -c \"$PSQL_BIN -d \"$PG_DB\" -w -t -P format=unaligned\""
|
||||||
|
echo "$sql"|su - $PG_USER -c "$PSQL_BIN -d "$PG_DB" -w -t -P format=unaligned"
|
||||||
}
|
}
|
||||||
|
|
||||||
function debug() {
|
function debug() {
|
||||||
if [ $DEBUG -eq 1 ]
|
if [ $DEBUG -eq 1 ]
|
||||||
then
|
then
|
||||||
echo "[DEBUG] $1"
|
>&2 echo "[DEBUG] $1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue