title: error syntax ( execute psql query from shell script )
body: <p>i got this query want to to be executed remotely on my 2nd server and</p>
  
  <pre><code>#!/bin/bash
  QUERY=`psql -h my2ndserverip  -d testdb -U testuser  'select count(*) as result   
  from testdb.user  where last_logged_date &gt; (clock_timestamp()  -interval '90    minutes)
   echo "users = $QUERY" &gt; tmp.txt
  </code></pre>
  
  <p>any tips to fix syntax ?</p>