Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-12 Thread Itagaki Takahiro
>> wrote: >> > Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: >> >> test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' >> >> ); >> >> ERROR:  role "public" does not exist >> > >> > Here's a patch implementing this idea. I applied it almost as-is, exce

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-12 Thread Alvaro Herrera
Excerpts from Itagaki Takahiro's message of mar oct 12 23:05:36 -0300 2010: > Hi, > > On Tue, Sep 7, 2010 at 6:16 AM, Alvaro Herrera > wrote: > > Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: > >> test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' >

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-12 Thread Robert Haas
On Tue, Oct 12, 2010 at 10:05 PM, Itagaki Takahiro wrote: > BTW, does the patch need to be back-patched to older versions? > Since they use get_roleid_checked() instead of get_role_oid(), the fix > cannot be applied cleanly to them, though it will be similar codes. I would interpret this a a feat

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-12 Thread Itagaki Takahiro
Hi, On Tue, Sep 7, 2010 at 6:16 AM, Alvaro Herrera wrote: > Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: >> test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' ); >> ERROR:  role "public" does not exist > > Here's a patch implementing this idea. It s

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-06 Thread KaiGai Kohei
(2010/10/07 2:05), Alvaro Herrera wrote: >>> Another thing that could raise eyebrows is that I chose to remove the >>> "missing_ok" argument from get_role_oid_or_public, so it's not a perfect >>> mirror of it. None of the current callers need it, but perhaps people >>> would like these functions t

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-06 Thread Alvaro Herrera
Excerpts from KaiGai Kohei's message of mar oct 05 00:06:05 -0400 2010: > (2010/09/07 6:16), Alvaro Herrera wrote: > > Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: > >> test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' > >> ); > >> ERROR: role "publ

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-10-04 Thread KaiGai Kohei
(2010/09/07 6:16), Alvaro Herrera wrote: > Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: >> test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' ); >> ERROR: role "public" does not exist > > Here's a patch implementing this idea. > I checked this patch

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-09-06 Thread Tom Lane
Alvaro Herrera writes: > Another thing that could raise eyebrows is that I chose to remove the > "missing_ok" argument from get_role_oid_or_public, so it's not a perfect > mirror of it. None of the current callers need it, but perhaps people > would like these functions to be consistent. Well, i

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-09-06 Thread Alvaro Herrera
Excerpts from Jim Nasby's message of jue jun 10 17:54:43 -0400 2010: > test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' ); > ERROR: role "public" does not exist Here's a patch implementing this idea. I'm not too sure about the wording in the doc changes. If somebody wan

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 11, 2010 at 8:51 AM, Simon Riggs wrote: >> It clearly rates higher in importance than most of the things on the >> open items list of late... > First, I don't think that's true. WALreceiver crashing on AIX, the > backup procedure in the manual possibly being wr

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 8:51 AM, Simon Riggs wrote: > On Wed, 2010-08-11 at 06:48 -0400, Robert Haas wrote: >> On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs wrote: >> > On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: >> >> Robert Haas writes: >> >> > On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 06:48 -0400, Robert Haas wrote: > On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs wrote: > > On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: > >> Robert Haas writes: > >> > On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: > >> >> So there's no way to see if a particular pr

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs wrote: > > On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: > >> Nothing.  The only reason to use those forms is in a join against > >> pg_authid, and the "public" group doesn't have an entry there. > > >

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs wrote: > On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: >> Robert Haas writes: >> > On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: >> >> So there's no way to see if a particular privilege has been granted to >> >> public. ISTM 'public' should

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Simon Riggs
On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: > Robert Haas writes: > > On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: > >> So there's no way to see if a particular privilege has been granted to > >> public. ISTM 'public' should be accepted, since you can't use it as a role > >> name an

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-07-03 Thread Nasby, Jim
On Jun 11, 2010, at 5:18 AM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: >>> So there's no way to see if a particular privilege has been granted to >>> public. ISTM 'public' should be accepted, since you can't use it as a role >>> name anyway... >

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-06-10 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: >> So there's no way to see if a particular privilege has been granted to >> public. ISTM 'public' should be accepted, since you can't use it as a role >> name anyway... > It's a bit sticky - you could make that work for >

[HACKERS] Bug / shortcoming in has_*_privilege

2010-06-10 Thread Jim Nasby
test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' ); ERROR: role "public" does not exist test...@workbook=# So there's no way to see if a particular privilege has been granted to public. ISTM 'public' should be accepted, since you can't use it as a role name anyway...

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-06-10 Thread Robert Haas
On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: > test...@workbook=# select has_table_privilege( 'public', 'test', 'SELECT' ); > ERROR:  role "public" does not exist > test...@workbook=# > > So there's no way to see if a particular privilege has been granted to > public. ISTM 'public' should be