Users and Roles configuration on Cloud SQL Postgres

Hi Team

I need to know what are the best practices and guidelines for user/roles configuration and management for cloud SQL PostgreSQL. Can we create another user similar to default Postgres or cloudsqladmin users ? which roles are required for day today DBA activities.

I tried to check in online docs but didn't t get specific information. I am new to GCP Environment Kindly help with some sample examples if possible.

Thanks

4 2 116
2 REPLIES 2

Hi @gxeon,

Welcome to Google Cloud Community!

The key points on Cloud SQL Postgres user and role configuration:

  • Use roles and least privilege: Assign roles with only the permissions users need for their tasks. Avoid using the powerful cloudsqlsuperuser role for everyday tasks.
  • Create custom roles: Define roles that group specific permissions for different user types (e.g., application user, DBA).
  • Manage users securely: Store passwords properly and consider Cloud IAP for extra protection.

You can create and manage users/roles using the Cloud Console or the psql client. Refer to the official documentation for detailed instructions and explore PostgreSQL predefined roles for common use cases.

Hi @christianpaula 

Thanks for kind response. regards to creating Create custom roles , Can you please explain a bit more how can to create custom roles with example, can it be done using only IAM authentication method or psql?

+ also please help to know what are Role/Grants /permissions are required if we migrate on prem Oracle Database to Cloud SQL PostgerSQL , i.e how to configure roles/user on the target database (i.e PG)  similar way as in source Database (oracle).