Re: New to postgresql - Do I have to be a "superuser" to be able to create a database?

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: New to postgresql - Do I have to be a "superuser" to be able to create a database?
Дата
Msg-id 1389043394.2442.36.camel@asus-1001PX.home
обсуждение исходный текст
Ответ на New to postgresql - Do I have to be a "superuser" to be able to create a database?  (gromitracer <george_m_se@yahoo.com>)
Список pgsql-general
Le dimanche 05 janvier 2014 à 19:32 -0800, gromitracer a écrit :

> Below are my roles/users and their attributes.  Posgresql version: 9.2
>
>    Role name     |            Attributes
> | Member of
> ---------------+-------------------------------------------------------------------------------+----------------
>  devs                | Create DB, Cannot login
> |   {}
>  batman            |
> |   {devs}
>  postgres          | Superuser, Create role, Create DB, Replication   |
> {}
>
>
> As you can see:
> role:  DEVS is configured to be able to create a database.
> user: batman is member of DEVS
>
> However, when I login as batman and I issue the command "CREATE DATABASE
> metropolis;"  I get a Permission denied. Even when I give DEVS a "superuser"
> attribute, user batman still cannot create a database. Do I have to elevate
> user batman to a superuser? Isn't that dangerous when it comes to security?
>

No need to be a superuser; see the CREATEDB clause in :

http://www.postgresql.org/docs/9.3/static/sql-createrole.html


You probably will also need to study :

http://www.postgresql.org/docs/9.3/static/sql-grant.html




--
http://litigios.libremen.com
Gestión de litigios y de expedientes de seguros de siniestros para el
servicio jurídico



В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: New to postgresql - Do I have to be a "superuser" to be able to create a database?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: authentication failure