I needed to create a PostgreSQL user that will have read only permissions on my database in order to do backups. I spent sometime trying to figure out how to do that. Most of this solution is inspired by this Stack Overflow answer. As I am fairly new to PostgreSQL I can’t assure the steps below represent the best approach to follow, I even believe some steps are unnecessary (which is something I will mention when in doubt). So let’s start from the beginning :

In your terminal, login as the postgres user (for security reasons, the postgres user has…

Zahim Anass

Software Engineer, Metalhead, Bass Guitar Player

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store