Skip to main content
Bumped by Community user
Bumped by Community user
added 554 characters in body; edited tags
Source Link

If I am creating a new Database on the same hostname/server, Will the roles/users carry over? Or will I have to create them again with new names and passwords?

I see roles/users listed as server objects, rather than database specific.enter image description here

So I'm not sure if they will carry over to a new DB. Both DBs share the same server/host.

Follow up Question: If I already have roles created across the server. And they currently have read_only access on certain schemas in Database A.

If I want to grant them access to create, insert, update etc permissions on schemas in DataBase B. I would just need to say: GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema1 in Database B TO role1?

This wouldn't affect their privileges in Database A, correct? Is it considered good practice for role1 to have readonly access in Database A and and create access in Database B?

If I am creating a new Database on the same hostname/server, Will the roles/users carry over? Or will I have to create them again with new names and passwords?

I see roles/users listed as server objects, rather than database specific.enter image description here

So I'm not sure if they will carry over to a new DB. Both DBs share the same server/host.

If I am creating a new Database on the same hostname/server, Will the roles/users carry over? Or will I have to create them again with new names and passwords?

I see roles/users listed as server objects, rather than database specific.enter image description here

So I'm not sure if they will carry over to a new DB. Both DBs share the same server/host.

Follow up Question: If I already have roles created across the server. And they currently have read_only access on certain schemas in Database A.

If I want to grant them access to create, insert, update etc permissions on schemas in DataBase B. I would just need to say: GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema1 in Database B TO role1?

This wouldn't affect their privileges in Database A, correct? Is it considered good practice for role1 to have readonly access in Database A and and create access in Database B?

edited tags; edited tags
Link
user1822
user1822
Source Link

Do Postgres Roles carry over from Databases if Databases are in the same server?

If I am creating a new Database on the same hostname/server, Will the roles/users carry over? Or will I have to create them again with new names and passwords?

I see roles/users listed as server objects, rather than database specific.enter image description here

So I'm not sure if they will carry over to a new DB. Both DBs share the same server/host.