diff -r 23fe531b2147 heartbeat/pgsql
--- a/heartbeat/pgsql	Wed Aug 18 14:29:37 2010 +0900
+++ b/heartbeat/pgsql	Wed Aug 18 14:32:13 2010 +0900
@@ -227,7 +227,10 @@
 #	Run the given command in the Resource owner environment...
 #
 runasowner() {
-    ocf_run su $OCF_RESKEY_pgdba -c "$*"
+    ocf_run su $OCF_RESKEY_pgdba -c "$*" 
+}
+runasowner_for_monitor() {
+    su $OCF_RESKEY_pgdba -c "$*"
 }
 
 #
@@ -415,7 +418,8 @@
            psql_options="$psql_options -h $OCF_RESKEY_socketdir"
        fi
     fi
-    runasowner "$OCF_RESKEY_psql $psql_options -c 'select now();'"
+
+    output=`runasowner_for_monitor "$OCF_RESKEY_psql $psql_options -c 'select now();'" 2>&1`
 
     rc=$?
     if [ $rc -ne  0 ]; then
@@ -427,6 +431,9 @@
         elif [ $rc -eq 3 ]; then
             ocf_log err "Script error (the variable ON_ERROR_STOP was set) occurred while executing the psql command."
         fi
+	if [ ! -z "$output" ]; then
+            ocf_log info "psql command output: $output"
+	fi
 	return $OCF_ERR_GENERIC
     fi
 
