0

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.

1 Answer 1

1

Check your pg_hba.conf file, that specifies which user on which host can connect to which database using what authentication mechanism.

You might want to base it on the content of the file in the working initial database.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.