RDBMS Information - PostgreSQL - How to setup a user in postgres that can only access one database triplet


This page provides assistance with setting up a user that can only access one database triplet. 

Applicable RDBMS




To setup a user which only has access to one database triplet (central/local/management) see the steps below.  This user will have read access to be able to see other schemas, but will not be able to see any tables or data in those other schemas.

  1. Run the following in pgadmin to create the user and privileges: (you can modify the userid and password used below for your specific use case):

    CREATE USER indra WITH password 'Test123' login inherit createdb createrole replication;
    GRANT ALL PRIVILEGES ON database postgres TO indra;
    1. The query only returns that it was successful or not, in creating the user and granting the privileges.

  2. Once the User is created, while connecting to the Server manager to create the Schemas you have to connect with the User created and create the schemas.
    1. Once the Schemas are created, you can login to the DB server with the new User name and password and even though you will be able to see the other schemas, you won't be able to access the tables and any data inside it.

 Ticket # 22679

Related Pages