Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Tom Lane
Stephen Frost [EMAIL PROTECTED] writes: Here's a much better version of the SET ROLE work. I'm reasonably happy with it. The only parts I don't like are that I had to do some ugly things in gram.y to avoid making NONE reserved, and I can't seem to see how to avoid having ROLE be reserved (I

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Tom Lane
Stephen Frost [EMAIL PROTECTED] writes: * Tom Lane ([EMAIL PROTECTED]) wrote: After rereading SQL99 4.31, I don't think there is any need to distinguish CURRENT_USER from CURRENT_ROLE, mainly because our implementation does not distinguish users from roles at all. CURRENT_USER and

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Tom Lane
BTW, I realized we do not support granting roles to PUBLIC: regression=# create role r; CREATE ROLE regression=# grant r to public; ERROR: role public does not exist but as far as I can tell SQL99 expects this to work. regards, tom lane ---(end

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote: BTW, I realized we do not support granting roles to PUBLIC: regression=# create role r; CREATE ROLE regression=# grant r to public; ERROR: role public does not exist but as far as I can tell SQL99 expects this to work. Indeed, I believe you're

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Tom Lane
Stephen Frost [EMAIL PROTECTED] writes: * Tom Lane ([EMAIL PROTECTED]) wrote: BTW, I realized we do not support granting roles to PUBLIC: regression=# create role r; CREATE ROLE regression=# grant r to public; ERROR: role public does not exist but as far as I can tell SQL99 expects

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Tom Lane
Another issue: I like the has_role() function and in fact think it needs to come in multiple variants just like has_table_privilege and friends: has_role(name, name) has_role(name, oid) has_role(oid, name) has_role(oid, oid) has_role(name) --

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote: Another issue: I like the has_role() function and in fact think it needs to come in multiple variants just like has_table_privilege and friends: has_role(name, name) has_role(name, oid) has_role(oid, name) has_role(oid, oid)

Re: [PATCHES] Roles - SET ROLE Updated

2005-07-21 Thread Andrew Dunstan
Tom Lane wrote: However I'm a bit dubious about whether has_role isn't an invasion of application namespace. pg_has_role would be better, but we have the (mis) precedent of has_table_privilege. What do you think about calling it has_role_privilege? Do we need to follow a bad