Re: How to create users for a login Role? - Mailing list pgsql-admin

From Albe Laurenz
Subject Re: How to create users for a login Role?
Date
Msg-id A737B7A37273E048B164557ADEF4A58B50FB7C7F@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to How to create users for a login Role?  (KhunSanAung <khunsanaung.gis@gmail.com>)
List pgsql-admin
KhunSanAung wrote:
> I know how to create a login role for a postgres database.
> I used pgAdmin III to create login role and database.
> or via psql command;
> postgres=# CREATE ROLE dbuser PASSWORD 'secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
> 
> 
> I'd like to know how to create users/members for each login role.
> How can I do it?
> I'd like to allow multiple users to access to a database.
> 
> I used postgres installed Ubuntu Server and access by pgAdmin III and SSH from Window OS.

I guess the problem here is a confusion over "user", "group" and "role".

In PostgreSQL, there is no difference between user and role.

A "group" is a role (usually with NOLOGIN), and a "user" is a role with LOGIN.
You add a "user" to a "group" by granting the "group" to the "user:

GRANT usergroup TO user1;

If you want to give a bunch of users a certain set of privileges,
grant the privileges to a NOLOGIN role and grant that role to the users.

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: Nikolay Popov
Date:
Subject: Re: Pacemaker dynamic membership
Next
From: Khaled McGonnell
Date:
Subject: Can't install