Re: change alter user to be a true alias for alter role

From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jov <amutu(at)amutu(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: change alter user to be a true alias for alter role
Date: 2014-06-27 14:11:21
Message-ID: 53AD7B89.1010905@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/19/2014 07:18 PM, Tom Lane wrote:
> Jov <amutu(at)amutu(dot)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.

After a week of silence from Jov, I decided to do this myself since it
didn't seem very hard.

Many frustrating hours of trying to understand why I'm getting
shift/reduce conflicts by the hundreds later, I've decided to give up
for now.
--
Vik

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-06-27 14:20:20 Re: Index-only scans and non-MVCC snapshots
Previous Message Andres Freund 2014-06-27 13:59:25 Re: Atomics hardware support table & supported architectures