title: PostgreSQL: How to pass parameters from command line?
body: <p>I have a somewhat detailed query in a script that uses <code>?</code> placeholders.  I wanted to test this same query directly from the psql command line (outside the script).  I want to avoid going in and replacing all the <code>?</code> with actual values, instead I'd like to pass the arguments after the query.</p>
  
  <p>Example:</p>
  
  <pre><code>SELECT  * 
  FROM    foobar
  WHERE   foo = ?
     AND  bar = ?
      OR  baz = ?  ;
  </code></pre>
  
  <p>Looking for something like:</p>
  
  <pre><code>%&gt; {select * from foobar where foo=? and bar=? or baz=? , 'foo','bar','baz' };
  </code></pre>