Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2012
    Posts
    2

    Unanswered: How to Add a User with Select Priviliges only

    Hi, I am new to Postgres SQL and have a task to add a user that will have permissions only to select from the database but not make any changes etc...

    I do not know how to do that, can anyone provide instructions?

    I have the following databases:

    Name | Owner |
    ------------+----------+
    mpower_dev | mpower |
    postgres | postgres |
    template0 | postgres |
    template1 | postgres

    I would like to grant the select only provileges to the new user on the mpower_dev database.

    Thank You

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    http://gkoenig.wordpress.com/2010/01/22/create-a-read-only-user-in-postgres-for-all-relations-in-several-schemas/

    http://stackoverflow.com/questions/760210/how-do-you-create-a-read-only-user-in-postgresql

  3. #3
    Join Date
    Jun 2012
    Posts
    2
    Hi shammat, the first link seemed to do the trick. But now I see the ro_group that i created cannot log in. How can I make it so that users part of this group can log in?

    postgres=# \du
    List of roles
    Role name | Attributes | Member of
    -----------+--------------+------------
    postgres | Superuser | {}
    : Create role
    : Create DB
    ro_group | Cannot login | {}
    ronly | | {ro_group}
    spaceuser | Superuser | {}
    : Create role
    : Create DB

  4. #4
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    http://www.postgresql.org/docs/current/static/role-membership.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •