How to create a read only user in Postgresql

Today I worked on an apparently simple problem. I would like to create a readonly user in postgresql database. This user must have read only rights on a specified schema which is not the public schema.

The first thing that you should know is that only the shema’s owner can grant privileges on the specified schema. Even if you done it with a superuser, you wont be able to grant the desired rights.

First of all, create the user :

Grant privileges on existing objects (i.e already created tables) :

Grant privileges on new objects (i.e future tables) :


Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/37/d447437781/htdocs/aemtuts/wp-includes/class-wp-comment-query.php on line 405

Leave a Reply