Alvaro Herrera a écrit :
> Cédric Villemain wrote:
>
>> Le jeudi 13 septembre 2007, Tom Lane a écrit :
>>
>>> Stéphane Schildknecht
>>>
>> <stephane.schildknecht@postgresqlfr.org> writes:
>>
>>>> It seems the shell command createuser and the SQL CREATE USER don't act
>>>> the same way,
>>>>
>>> They aren't really claimed to.
>>>
>> But the man say :
>> " createuser is a wrapper around the SQL command CREATE ROLE [create_role(7)].
>> There is no effective difference between creating users via this utility and
>> via other methods for accessing the server."
>>
>
> Note that CREATE ROLE behaves slightly differently from CREATE USER.
>
>
The result is exactly the same, here...
test=# create role testrole superuser;
CREATE ROLE
test=# \du                              List of rolesRole name | Superuser | Create role | Create DB | Connections |
Memberof 
-----------+-----------+-------------+-----------+-------------+-----------
testrole  | yes       | no          | no        | no limit    |
test=# alter role testrole nosuperuser;
ALTER ROLE
test=# \du                              List of rolesRole name | Superuser | Create role | Create DB | Connections |
Memberof 
-----------+-----------+-------------+-----------+-------------+-----------
testrole  | no        | no          | no        | no limit    |
So a superuser which has not been explicitly created with "createuser"
and "create DB" privileges will become a no privilege while losing the
status superuser.
If created with the Unix command createuser, he won't.
Best regards,
SAS