title: Logging SQL script errors
body: <p>I have a SQL script for postgres file with following command.</p>
  
  <pre><code>COPY product_master(productId, productName) FROM 'product.txt' DELIMITERS ',' CSV; 
  </code></pre>
  
  <p>I want to handle errors of this command (log the error)</p>
  
  <p>example </p>
  
  <blockquote>
    <p>ERROR: duplicate key value violates.</p>
  </blockquote>
  
  <p>Does the <code>COPY</code> command return any value ? If no, then how to log the output of the shell script?</p>