Manage data security in your service
Restrict data access with read-only PostgreSQL roles
When you create a service, Tiger Cloud assigns you the tsdmadmin role. This role has full permissions to modify data in your service. However, Tiger Cloud does not provide superuser access. tsdmadmin is not a superuser.
As tsdmadmin, you can use standard PostgreSQL means to create other roles or assign individual permissions. This page shows you how to create a read-only role for your database. Adding a read-only role does not provide resource isolation. To restrict the access of a read-only user, as well as isolate resources, create a read replica instead.
Create a read-only user
You can create a read-only user to provide limited access to your database.
- Connect to your service as the tsdbadmin user
- Create the new roleCREATE ROLE readaccess;
- Grant usage on the schema to allow access to objects within itGRANT USAGE ON SCHEMA <SCHEMA_NAME> TO readaccess;
- Grant the appropriate permissions for the role, as required
For example, to grant
SELECTpermissions to a specific table, use:GRANT SELECT ON <TABLE_NAME> TO readaccess;To grant
SELECTpermissions to all tables in a specific schema, use:GRANT SELECT ON ALL TABLES IN SCHEMA <SCHEMA_NAME> TO readaccess; - Create a new userCREATE USER read_user WITH PASSWORD 'read_password';
- Assign the role to the new userGRANT readaccess TO read_user;