Re: CREATE USER and createuser not working the same

From: Stéphane Schildknecht <stephane(dot)schildknecht(at)postgresqlfr(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: CREATE USER and createuser not working the same
Date: 2007-09-27 12:24:24
Message-ID: 46FBA0F8.7040305@postgresqlfr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alvaro Herrera a écrit :
> Cédric Villemain wrote:
>
>> Le jeudi 13 septembre 2007, Tom Lane a écrit :
>>
>>> =?ISO-8859-1?Q?St=E9phane_Schildknecht?=
>>>
>> <stephane(dot)schildknecht(at)postgresqlfr(dot)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 roles
Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
testrole | yes | no | no | no limit |
test=# alter role testrole nosuperuser;
ALTER ROLE
test=# \du
List of roles
Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2007-09-28 01:23:29 Re: BUG #3638: UTF8 Character encoding does NOT work
Previous Message Hannu Valtonen 2007-09-27 10:41:40 Re: BUG #3639: queryplanner degrades to a sequential scan even if there's an index