This is a discussion on Roles - SET ROLE Updated within the Pgsql Patches forums, part of the PostgreSQL category; --> * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Another issue: I like the has_role() function and in fact think it needs ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| * Tom Lane (tgl@sss.pgh.pa.us) 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) > has_role(name) -- implicitly has_role(current_user, ...) > has_role(oid) > > 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"? I thought about that originally. It seemed a bit long to me and I felt that having the 'privilege' of a role wasn't quite the same as having a 'role', but honestly I'm not terribly picky and on reflection a role *is* like other objects in the catalog (I originally hadn't considered it such), so, that's fine with me... has_role() was another reason I was thinking about having a seperate function for 'is_member_of_role' which didn't pollute the cache, just a side-note. Thanks, Stephen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC3/4+rzgMPqB3kigRAkpmAJoD/M4JQYgh6UX9+fM19+m1BDlwDgCcCQMX aNmyokkRykbd4TGGV2nzvN0= =7Uj/ -----END PGP SIGNATURE----- |
| ||||
| 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 precedent for the sake of consistency? If forced to choose, in general I would prefer to sacrifice consistency. cheers andrew (old Emersonian) ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| Thread Tools | |
| Display Modes | |
|
|