title: how to stop and exit from the postgresql restoration if an error occurs
body: <p>we are trying to restore PostgreSQL schema dumps into a database from the command line using the below command
  </p>
  
  <pre><code>psql -U postgres -d dbname &lt; filename
  </code></pre>
  
  <p>and we are getting response in command line during the restoration like below</p>
  
  <pre class="lang-none prettyprint-override"><code>SET
  SET
  SET
  SET
  SET
  CREATE SCHEMA
  ALTER SCHEMA
  .
  .
  .
  .
  </code></pre>
  
  <p>and going on</p>
  
  <p>My question is, if there are some errors happened in between the restoration and restoration continues to go on, how to detect that error without scrolling through these entire response through command line? or 
  Is there anyway to automatically stop and exit from the restoration process if an error occurs?</p>
  
  <p>We are using PostgreSQL 10</p>