GRANT read only access to a PostgreSQL database for a user
In your terminal, login as the postgres user (for security reasons, the postgres user has no password. That’s why we are logging in using -i option) Connect to the PostgreSQL interactive terminal. Notice that you should mention the name of the concerned database, otherwise you will be doing operations on the postgres default database instead. Allow the user to connect to