Re: Inconsistencies with create role - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Inconsistencies with create role
Date
Msg-id 27000.1124759573@sss.pgh.pa.us
Whole thread Raw
In response to Inconsistencies with create role  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Inconsistencies with create role  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
"Joshua D. Drake" <jd@commandprompt.com> writes:
> foo=# create role foo with createdb;
> CREATE ROLE
> foo=# create user foo;
> ERROR:  role "foo" already exists

> I understand what is happening, but perhaps the error should be:
> A role "foo" already exists which can not be the same as a username?

The documentation already says prominently that roles and users are
the same thing.  If you're fooling with CREATE ROLE without having
read any of that, I'm not sure that an error message will help.

Also, although the SQL standard thinks that roles and users are
distinct, it requires them to have distinct names; this is necessary
because <authorization identifier> doesn't syntactically distinguish
between the two cases.  So there's no support in the spec either for
supposing that you can create both user foo and role foo.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Let's drop some GUCs (bgwriter)
Next
From: Tom Lane
Date:
Subject: Re: CREATE USER and pg_user