Re: alter user/role CURRENT_USER
От | Alvaro Herrera |
---|---|
Тема | Re: alter user/role CURRENT_USER |
Дата | |
Msg-id | 20141028095656.GB1791@alvin.alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: alter user/role CURRENT_USER (Marti Raudsepp <marti@juffo.org>) |
Список | pgsql-hackers |
Marti Raudsepp wrote: > On Fri, Oct 24, 2014 at 11:29 AM, Kyotaro HORIGUCHI > <horiguchi.kyotaro@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
В списке pgsql-hackers по дате отправления: