PostgreSQL - How to check user privileges

PostgreSQL - How to check user privileges

Colleagues hello to all.

In today's article, we'll talk about how to see what permissions a user has in a PostgreSQL database.

In PostgreSQL, a privilege refers to a specific permission to perform an action on a database on a server. For example, a privilege can include the right to log into a database to perform various operations on the data.

 

To view the user's privileges in the PostgreSQL database, we can use a sql query.

sql> SELECT * FROM information_schema.table_privileges WHERE grantee = 'postgres' LIMIT 10;

postgresql privileges

As a result, we get all the privileges that the postgres user has. The grantor field indicates who granted the right, and the grantee field indicates the recipient of that right.


 

Thank you all, I hope that my article helped you in some way.

 

SIMILAR ARTICLES

PostgreSQL - How to determine which files on disk correspond to tables in a database
PostgreSQL - How to determine which files on disk correspond to tables in a database
POSTGRESQL
Read more
PostgreSQL - How to find out the size of tables in a database
PostgreSQL - How to find out the size of tables in a database
POSTGRESQL
Read more
PostgreSQL - How to enable archiving of WAL logs - archive_mode
PostgreSQL - How to enable archiving of WAL logs - archive_mode
POSTGRESQL
Read more