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.
i created a dump with
pg_dump database1 > dbdump
Then i create a database with
createdb database2
Then i used the dump to restore the newly created database.
psql database2 < dbdump
To see the permissions i did a \l
and i have the following:
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)
As you can see, the Access privileges aren't the same on database2.
I tried the following command,
GRANT ALL ON ALL TABLES IN SCHEMA public TO root;
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.