title: How to Quote a psql statement using su -c an a bash script?
body: <p>I am trying the following statement in a bash script: </p>
  
  <pre><code>su -c  "psql -d myDB-c 'SELECT count(*) AS number, date_trunc('day'::text, users.registerdate) AS registerdate FROM users;'" postgres
  </code></pre>
  
  <p>The Problem is the <code>'day'</code> parameter which needs to be quoted, but inside the quotes it doesn't work. </p>