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"
|
||||
|
||||
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() {
|
||||
if [ $DEBUG -eq 1 ]
|
||||
then
|
||||
echo "[DEBUG] $1"
|
||||
>&2 echo "[DEBUG] $1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue