How to create a read-only user in the backend PostgreSQL database?

How to create a read-only user in the backend PostgreSQL database?

1. Connect to the backend PostgreSQL database where Applications Manager database (AMDB) is stored.
Use the Postgres user for connection. For more details, refer this link.

2. After connecting to the PostgreSQL database, execute the following queries:
  1. create user readonly password 'test';
  2. alter user readonly set default_transaction_read_only = on;
  3. \c amdb;
  4. grant usage on schema public to readonly;
  5. grant select on all tables in schema public to readonly;

After executing the above queries, you can connect to Applications Manager database (AMDB) using the new 'readonly' user and verify the connection.
                  New to ADManager Plus?

                    New to ADSelfService Plus?