Re: CREATE USER and createuser not working the same - Mailing list pgsql-bugs

From Stéphane Schildknecht
Subject Re: CREATE USER and createuser not working the same
Date
Msg-id 46FBA0F8.7040305@postgresqlfr.org
Whole thread Raw
In response to Re: CREATE USER and createuser not working the same  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Hannu Valtonen
Date:
Subject: Re: BUG #3639: queryplanner degrades to a sequential scan even if there's an index
Next
From: Tatsuo Ishii
Date:
Subject: Re: BUG #3638: UTF8 Character encoding does NOT work