title: How do I escape single quote in command line query of psql?
body: <p>I googled a lot but..</p>
  
  <p>How do I escape single quote in command line  query of psql ?</p>
  
  <pre><code>psql -t -A -F $'\t' postgresql://zzzz:5432/casedb -U qqqq -c 'select id,ext_ids -&gt;&gt; 'qwe' as qwe from data ORDER BY qwe' &gt; /jdata/qwe.tab
  </code></pre>
  
  <p>Results in error</p>
  
  <pre><code>ERROR:  column "qwe" does not exist
  LINE 1: select id,ext_ids -&gt;&gt; qwe as qwe from data...
  </code></pre>