title: Import SQL dump into PostgreSQL database
body: <p>We are switching hosts and the old one provided a SQL dump of the PostgreSQL database of our site.</p>
  
  <p>Now, I'm trying to set this up on a local WAMP server to test this.</p>
  
  <p>The only problem is that I don't have an idea how to import this database in the PostgreSQL 9 that I have set up.</p>
  
  <p>I tried pgAdmin III but I can't seem to find an 'import' function. So I just opened the SQL editor and pasted the contents of the dump there and executed it, it creates the tables but it keeps giving me errors when it tries to put the data in it.</p>
  
  <pre><code>ERROR:  syntax error at or near "t"
  LINE 474: t 2011-05-24 16:45:01.768633 2011-05-24 16:45:01.768633 view...
  
  The lines:
  COPY tb_abilities (active, creation, modtime, id, lang, title, description) FROM stdin;
  t   2011-05-24 16:45:01.768633  2011-05-24 16:45:01.768633  view    nl ...  
  </code></pre>
  
  <p>I've also tried to do this with the command prompt but I can't find the command that I need.</p>
  
  <p>If I do</p>
  
  <pre><code>psql mydatabase &lt; C:/database/db-backup.sql;
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>ERROR:  syntax error at or near "psql"
  LINE 1: psql mydatabase &lt; C:/database/db-backu...
          ^
  </code></pre>
  
  <p>What's the best way to import the database?</p>