Обсуждение: user privileges

Поиск
Список
Период
Сортировка

user privileges

От
Atul Kumar
Дата:
Hi,

My question can be silly but I need to ask that if a user is created
without login privilege then what is the use of below command why
don't postgres prompt error on it

CREATE ROLE nolog_user WITH PASSWORD 'pass1';

as the user is created with login privileges then what is the use such user ?

Where such users having no login privileges can be used ?



Regards.



Re: user privileges

От
Charles Clavadetscher
Дата:
Hello

On 2021-06-21 12:40, Atul Kumar wrote:
> Hi,
> 
> My question can be silly but I need to ask that if a user is created
> without login privilege then what is the use of below command why
> don't postgres prompt error on it
> 
> CREATE ROLE nolog_user WITH PASSWORD 'pass1';

A user without login privilege is usally called a group and is used for 
bundling privileges that you can grant granting the role to individual 
users. This helps you to keep more order and structure in your DB 
privileges.

You may also have a user that can login and for whatever reason must be 
restricted access for a certain time.

> as the user is created with login privileges then what is the use such 
> user ?

See above.

> Where such users having no login privileges can be used ?

Yes, you use it as a group.

-- 
Charles Clavadetscher
Spitzackerstrasse 9
CH - 8057 Zürich

https://www.swisspug.org

+------------------------+
|   ____  ______  ___    |
|  /    )/      \/   \   |
| (     / __    _\    )  |
|  \    (/ o)  ( o)   )  |
|   \_  (_  )   \ ) _/   |
|     \  /\_/    \)/     |
|      \/ <//|  |\\>     |
|           _|  |        |
|           \|_/         |
|                        |
|    Swiss PostgreSQL    |
|       Users Group      |
+------------------------+



Re: user privileges

От
Laurenz Albe
Дата:
On Mon, 2021-06-21 at 16:10 +0530, Atul Kumar wrote:
> My question can be silly but I need to ask that if a user is created
> without login privilege then what is the use of below command why
> don't postgres prompt error on it
> 
> CREATE ROLE nolog_user WITH PASSWORD 'pass1';
> 
> as the user is created with login privileges then what is the use such user ?

The role can be the owner of objects, or it can have members that
inherit privileges.

But setting a password is pointless on a role that cannot login.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com