Re: [HACKERS] restructuring "alter table" privilege checks

2010-01-24 Thread KaiGai Kohei
(2010/01/24 12:40), KaiGai Kohei wrote: Perhaps, it may be a good idea to make two conceptual patches both head of the ATPrepCmd() and ATExec*(). They will make clear good/bad points between two approaches. I tried to make two conceptual patches. * pgsql-at-rework-prep.1.patch It adds ATPermC

Re: [HACKERS] restructuring "alter table" privilege checks

2010-01-23 Thread KaiGai Kohei
(2010/01/24 12:16), Robert Haas wrote: On Sat, Jan 23, 2010 at 10:11 PM, KaiGai Kohei wrote: If we put the new ATSimplePermissions() with all the needed information just after gathering them at the execution stage, we don't need to have some of exceptions which takes additional checks except fo

Re: [HACKERS] restructuring "alter table" privilege checks

2010-01-23 Thread Robert Haas
On Sat, Jan 23, 2010 at 10:11 PM, KaiGai Kohei wrote: > If we put the new ATSimplePermissions() with all the needed information > just after gathering them at the execution stage, we don't need to have > some of exceptions which takes additional checks except for ownership > on the relation to be

Re: [HACKERS] restructuring "alter table" privilege checks

2010-01-23 Thread KaiGai Kohei
(2010/01/24 11:27), Robert Haas wrote: On Sat, Jan 23, 2010 at 8:33 PM, KaiGai Kohei wrote: (2010/01/24 9:08), Robert Haas wrote: On Sat, Jan 23, 2010 at 2:17 AM, KaiGai Koheiwrote: However, it is unclear for me whether the revised ATSimplePermissions() provide cleaner code than current

Re: [HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-23 Thread Robert Haas
On Sat, Jan 23, 2010 at 8:33 PM, KaiGai Kohei wrote: > (2010/01/24 9:08), Robert Haas wrote: >> >> On Sat, Jan 23, 2010 at 2:17 AM, KaiGai Kohei  wrote: >>> >>> However, it is unclear for me whether the revised ATSimplePermissions() >>> provide cleaner code than currently we have, because it also

Re: [HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-23 Thread KaiGai Kohei
(2010/01/24 9:08), Robert Haas wrote: On Sat, Jan 23, 2010 at 2:17 AM, KaiGai Kohei wrote: However, it is unclear for me whether the revised ATSimplePermissions() provide cleaner code than currently we have, because it also needs a big switch ... case statement within. Am I misunderstanding so

Re: [HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-23 Thread Robert Haas
On Sat, Jan 23, 2010 at 2:17 AM, KaiGai Kohei wrote: > However, it is unclear for me whether the revised ATSimplePermissions() > provide cleaner code than currently we have, because it also needs > a big switch ... case statement within. > > Am I misunderstanding something? Well, not everyone is

Re: [HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-22 Thread KaiGai Kohei
(2010/01/23 1:27), Robert Haas wrote: So, what if we treat these two cases separately? The part-B checks - on the other operations involved in ALTER TABLE - are by definition idiosyncratic. What type of object we're checking and what permission we're checking for is inextricably bound up with w

Re: [HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-22 Thread Tom Lane
Robert Haas writes: >> * Tom Lane (t...@sss.pgh.pa.us) wrote: I don't particularly like this patch, mainly because I disagree with randomly removing permissions checks without any sort of plan about where they ought to go. > [ a plan for rearranging ALTER TABLE's checks ] Works fo

[HACKERS] restructuring "alter table" privilege checks (was: remove redundant ownership checks)

2010-01-22 Thread Robert Haas
On Thu, Dec 17, 2009 at 10:09 PM, Stephen Frost wrote: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> KaiGai Kohei writes: >> > [ patch to remove EnableDisableRule's permissions check ] >> >> I don't particularly like this patch, mainly because I disagree with >> randomly removing permissions checks