Creating users in PostgreSQL
#
How to add a Read-Only User to a PostgreSQL Database1. Create a new user:
This creates a new user with given username and password. By default password is set to never expire.
2. Grant user access to connect to the database:
3. Grant user access to specific schema:
4. Grant select access to table(s)
For a specific table:
For all tables in specific schema:
#
OptionalIf you want user to have select access to all new tables created in the future: