Re: How to create users for a login Role?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux