Improve debug mode about master SQL request
This commit is contained in:
parent
f883216050
commit
54b9b79023
1 changed files with 7 additions and 1 deletions
|
@ -120,6 +120,12 @@ function psql_get () {
|
||||||
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 psql_master_get () {
|
||||||
|
sql="$1"
|
||||||
|
debug "Exec 'echo \"$sql\"|su - $PG_USER -c \"$PSQL_BIN -U $M_USER -h $M_HOST -w -p $M_PORT -d $PG_DB -t -P format=unaligned\""
|
||||||
|
echo "$sql"|su - $PG_USER -c "$PSQL_BIN -U $M_USER -h $M_HOST -w -p $M_PORT -d $PG_DB -t -P format=unaligned"
|
||||||
|
}
|
||||||
|
|
||||||
function debug() {
|
function debug() {
|
||||||
if [ $DEBUG -eq 1 ]
|
if [ $DEBUG -eq 1 ]
|
||||||
then
|
then
|
||||||
|
@ -211,7 +217,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get current xlog file from master
|
# Get current xlog file from master
|
||||||
M_CUR_XLOG="$( echo 'SELECT pg_current_xlog_location()'|su - $PG_USER -c "$PSQL_BIN -U $M_USER -h $M_HOST -p $M_PORT -d $PG_DB -t -P format=unaligned" )"
|
M_CUR_XLOG="$( psql_master_get 'SELECT pg_current_xlog_location()' )"
|
||||||
if [ ! -n "$M_CUR_XLOG" ]
|
if [ ! -n "$M_CUR_XLOG" ]
|
||||||
then
|
then
|
||||||
echo "UNKNOWN : Can't retreive current xlog from master server"
|
echo "UNKNOWN : Can't retreive current xlog from master server"
|
||||||
|
|
Loading…
Reference in a new issue