title: how to avoid column in 'where' clause if parameter is 'NOT PASSED' postgresql
body: <p>Running Query : </p>
  
  <p><code>select * from employee where name = $1 and age = $2 and salary =  $3;</code></p>
  
  <p>Problem Query : </p>
  
  <p><code>select * from employee where name = $1 and age = $2;</code></p>
  
  <p><strong>How can I write A Logic That</strong>
  /* If $3 is PASSED Then (<code>and salary =  $3</code> ) */</p>
  
  <p><strong>Note</strong> : 
  /* I Cannot <strong>check</strong> For <strong>null</strong> or <strong>Empty</strong> as <strong>$3</strong> as not passed then <strong>$3</strong> won't be available for <strong>check*</strong>/</p>
  
  <p><em>In Node I Am using Like This</em></p>
  
  <pre><code>        postGresAdaptor.executeQueryWithParameters(QUERY, QUERYPARAMS, function(error, result) {
              if (error) {
                  callback(error);
              } else {                    
                  data = result.data;                    
              }
          });
  </code></pre>
  
  <p>Don't Want To Add Logic in node code as there will be lots of queries on the way.</p>