Re: restructuring "alter table" privilege checks

From: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: restructuring "alter table" privilege checks
Date: 2010-01-24 03:40:37
Message-ID: 4B5BC135.8060903@kaigai.gr.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2010/01/24 12:16), Robert Haas wrote:
> On Sat, Jan 23, 2010 at 10:11 PM, KaiGai Kohei<kaigai(at)kaigai(dot)gr(dot)jp> 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 altered.
>
> Maybe I'm still not understanding, but I don't see how you're going to
> do this without a massive pile of spaghetti code and a function with
> about 12 parameters. Feel free to show some code, but I think this is
> a non-starter.

Hhmmm,...

Indeed, indeed, if a single function tries to handle all the ALTER TABLE
options, it needs many function arguments, because ALTER TABLE is one of
the most functional statement in PostgreSQL...

If the basis is head of the execution phase, it does not need a big switch
... case branch in ATSimplePermissions, because it is already branched in
ATExecCmd(). However, it also has tradeoff that we have multiple minor version
of functions to check ALTER TABLE permissions.

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.

Is it waste of efforts?

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-01-24 03:48:35 Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns
Previous Message Robert Haas 2010-01-24 03:29:23 Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns