Re: Inconsistencies with create role

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inconsistencies with create role
Date: 2005-08-23 01:12:53
Message-ID: 27000.1124759573@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-23 01:19:46 Re: CREATE USER and pg_user
Previous Message Tom Lane 2005-08-23 00:42:33 Re: Let's drop some GUCs (bgwriter)