Marti Raudsepp wrote:
> On Fri, Oct 24, 2014 at 11:29 AM, Kyotaro HORIGUCHI
> <horiguchi.kyot...@lab.ntt.co.jp> wrote:
> >  - 0001-ALTER-ROLE-CURRENT_USER_v2.patch  - the patch.
> 
> +RoleId:        CURRENT_USER                            { $$ = 
> "current_user";}
> +           | USER                                  { $$ = "current_user";}
> +           | CURRENT_ROLE                          { $$ = "current_user";}
> +           | SESSION_USER                          { $$ = "session_user";}
> 
> This is kind of ugly, and it means you can't distinguish between a
> CURRENT_USER keyword and a quoted user name "current_user". It's a
> legitimate user name, so the behavior of the following now changes:
> 
> CREATE ROLE "current_user";
> ALTER ROLE "current_user" SET work_mem='10MB';
> 
> There ought to be a better way to represent this than using magic string 
> values.

Agreed.  Since the current_user disease has already infected the USER
MAPPING stuff, I think we need to solve that problem -- how about having
this production return a new node which has either a string name or
flags for the various acceptable keywords?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to