title: Moving a database with pg_dump and psql -U postgres db_name < ... results in "ERROR: relation "table_name" does not exist"
body: <p>I moved my PostgresQL database from one hard drive to another using</p>
  <pre><code>pg_dump -U postgres db_name &gt; db_name.dump
  </code></pre>
  <p>and then</p>
  <pre><code>psql -U postgres db_name &lt; db_name.dump
  </code></pre>
  <p>I created the database db_name the same way in both instances.  In the new database when I run my Java program with a JPA query (or a JDBC query) I get this error:</p>
  <pre><code>&quot;ERROR: relation &quot;table1&quot; does not exist&quot;
  </code></pre>
  <p>The query is:</p>
  <pre><code>select count(0) from table1
  </code></pre>
  <p>I know I've got a connection because if I change the password in the connection parameters I get an error.</p>
  <p>For some reason in the new PostgresQL instance it thinks that table1 does not exist in the imported schema.</p>
  <p>If I change the query to</p>
  <p>select count(0) from myschema.table1</p>
  <p>Then it complains about permissions:</p>
  <pre><code>&quot;ERROR: permission denied for schema myschema&quot;
  </code></pre>
  <p>Why would the permissions be different?</p>
  <p>The table table1 exists in myschema because I can see it in the pgAdmin tool.  All the rows were imported into the new PostgresQL instance.</p>
  <p>When I do a query from Java the combination of pg_dump and psql created a problem.</p>
  <p>What do I need to do to solve this issue?</p>