diff --git a/check_pg_streaming_replication b/check_pg_streaming_replication index cdab14e..99369e6 100755 --- a/check_pg_streaming_replication +++ b/check_pg_streaming_replication @@ -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 }