Account privileges

From: Prathima Mulpuri <prathima(dot)mulpuri(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Account privileges
Date: 2021-11-17 02:07:14
Message-ID: D8DC8DCB-C339-4D05-859D-9B1DE53A9C89@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
I need some help regarding Postgres and I have checked and tried many queries.
I am working on RDS Postgres 13 and in the process of preparing the script for auditing all the user privileges . As a part of our auditing, I need a script to list down all the privileges of all the users to each database and if any privilege that I need is missing, it should automatically execute the grant /revoke (for example account1 should have only select privileges. If it is granted with anything else it should revoke the permissions and if select is not granted it should grant the select privilege) . This should be done for all the databases in an instance in 1 script.
I want to use cursor to list the databases and to run the check and execute queries using a function or a stored procedure. The results of the script should be sent to an email.

Please share any ideas and solutions for my requirement.

Thank you
Prathima

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-11-17 02:28:13 Re: Account privileges
Previous Message Дмитрий Иванов 2021-11-17 02:06:25 Re: pg_restore depending on user functions