title: granting database access privileges in postgres
body: <p>I have a database currently with the correct permissions. I'm attempting to create a duplicate but i can't get the permissions to be the same. </p>
  
  <p>i created a dump with</p>
  
  <p><code>pg_dump database1 &gt; dbdump</code></p>
  
  <p>Then i create a database with </p>
  
  <p><code>createdb database2</code></p>
  
  <p>Then i used the dump to restore the newly created database. </p>
  
  <p><code>psql database2 &lt; dbdump</code></p>
  
  <p>To see the permissions i did a <code>\l</code> and i have the following:</p>
  
  <pre><code>                                  List of databases
     Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
  -----------+----------+----------+-------------+-------------+-----------------------
   database1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =T/postgres          +
             |          |          |             |             | postgres=CTc/postgres+
             |          |          |             |             | root=CTc/postgres
   database2 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
   template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
  (5 rows)
  </code></pre>
  
  <p>As you can see, the Access privileges aren't the same on database2. </p>
  
  <p>I tried the following command, </p>
  
  <p><code>GRANT ALL ON ALL TABLES IN SCHEMA public TO root;</code></p>
  
  <p>but that didn't seem to change anything and i can't log into the database over SSH using the username/password i can with database1. </p>