From: | David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: alter user/role CURRENT_USER |
Date: | 2014-10-28 01:28:12 |
Message-ID: | 1414459692739-5824528.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Marti Raudsepp wrote
> On Fri, Oct 24, 2014 at 11:29 AM, Kyotaro HORIGUCHI
> <
> horiguchi(dot)kyotaro(at)(dot)co
> > wrote:
>
> But should ALTER USER ALL and ALTER ROLE ALL really do the same thing?
> A user is a role with the LOGIN option. Every user is a role, but not
> every role is a user. I suspect that ambiguity was why ALTER USER ALL
> wasn't originally implemented.
There is no system level distinction here - only semantic and only during
the issuance of a CREATE without specifying an explicit value for
LOGIN/NOLGIN.
The documentation states user and group are aliases for ROLE, not subsets
that require or disallow login privileges.
I am OK with not making them true aliases in order to minimize user
confusion w.r.t. the semantics implied by user and group but then I'd submit
we simply note those two forms as deprecated in favor of role and that all
new role-based functionality will only be attached to role-based commands.
Since all of user, current_user and session_user have special syntactic
consideration in SQL [1] I'd be generally in favor of trying to keep that
dynamic intact while implementing this feature. And for the same reason I
would not allow current_role as a keyword. We didn't add a current_role
function but instead chose to rely on the standard keywords even when we
introduced ROLE.
I'm not clear on the keyword confusion since while "current_user" is a valid
literal it requires quotation while the token current_user does not.
1. http://www.postgresql.org/docs/9.4/static/functions-info.html
David J.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/alter-user-role-CURRENT-USER-tp5822520p5824528.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2014-10-28 01:44:18 | Re: Reducing the cost of sinval messaging |
Previous Message | Stephen Frost | 2014-10-28 00:58:45 | Re: Directory/File Access Permissions for COPY and Generic File Access Functions |