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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jov <amutu(at)amutu(dot)com>
Cc: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: change alter user to be a true alias for alter role
Date: 2014-08-23 22:23:25
Message-ID: 21570.1408832605@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jov <amutu(at)amutu(dot)com> writes:
> I make the v2 of the patch,use Tom's advice.
> But I can't make ROLE and USER in the keyword list,it is hard to solve the
> conflict,or rewrite many gram rules.

This patch seems to be trying to make ROLE and USER interchangeable
*everywhere* in the grammar, which is moving the goalposts quite a long
way to little purpose. The idea seems rather misguided to me, since
certainly CREATE USER and CREATE ROLE will never be exact synonyms.
I think it's sufficient to solve the original complaint about them not
being interchangeable in ALTER.

The patch as given is broken anyway: it removes both those keywords
from the keyword lists, which effectively makes them fully reserved,
in fact worse than fully reserved.

What I had in mind was more like the attached, which I've not tested
but bison does compile it without complaint. I've not looked at the
documentation end of it, either.

regards, tom lane

Attachment Content-Type Size
alter-role-or-user.patch text/x-diff 5.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2014-08-23 22:39:30 Re: proposal: rounding up time value less than its unit.
Previous Message Noah Misch 2014-08-23 21:32:27 Re: Removing dependency to wsock32.lib when compiling code on WIndows