Re: change alter user to be a true alias for alter role - Mailing list pgsql-hackers

From Tom Lane
Subject Re: change alter user to be a true alias for alter role
Date
Msg-id 4021.1403198328@sss.pgh.pa.us
Whole thread Raw
In response to change alter user to be a true alias for alter role  (Jov <amutu@amutu.com>)
Responses Re: change alter user to be a true alias for alter role  (Vik Fearing <vik.fearing@dalibo.com>)
Re: change alter user to be a true alias for alter role  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-hackers
Jov <amutu@amutu.com> writes:
> the doc say:
>> ALTER USER is now an alias for ALTER ROLE<http://www.postgresql.org/docs/devel/static/sql-alterrole.html>

> but alter user lack the following format:
> ...

If we're going to have a policy that these commands be exactly equivalent,
it seems like this patch is just sticking a finger into the dike.  It does
nothing to prevent anyone from making the same mistake again in future.

What about collapsing both sets of productions into one, along the lines
of

role_or_user: ROLE | USER;

AlterRoleSetStmt:ALTER role_or_user RoleId opt_in_database SetResetClause

(and similarly to the latter for every existing ALTER ROLE variant).

Because MAPPING is an unreserved keyword, I think that this approach
might force us to also change ALTER USER MAPPING to ALTER role_or_user
MAPPING, which is not contemplated by the SQL standard.  But hey,
it would satisfy the principle of least surprise no?  Anyway we don't
have to document that that would work.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Crash on backend exit w/ OpenLDAP [2.4.24, 2.4.31]
Next
From: Claudio Freire
Date:
Subject: Re: Minmax indexes