Re: New patch for Column-level privileges - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Re: New patch for Column-level privileges
Date
Msg-id 49654F98.4010100@ak.jp.nec.com
Whole thread Raw
In response to Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
Responses Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost wrote:
> KaiGai,
> 
> * KaiGai Kohei (kaigai@ak.jp.nec.com) wrote:
>>> Is it possible to implement a walker function to pick up appeared
>>> columns and to chain them on rte->cols_sel/cols_mod?
>>> In this idea, columns in Query->targetList should be chained on
>>> rte->cols_mod, and others should be chained on rte->cols_sel.
> 
> This sounds like a reasonable approach to me, but as I mentioned before,
> I'm not very familiar with the analyzer and company.
> 
>> The attached patch is a proof of the concept.
> 
> Excellent, I'll play around with it.
> 
>> Any comment?
> 
> I'm generally not a huge fan of recursion simply because it's often
> overrated and overused and implements a limit based on stack depth which
> can cause unexpected failures.  Can we be confident that the recursion
> added here doesn't add a new limit on the size/complexity of queries
> which, if hit, will cause a stack overflow?  I notice that we do use
> recursion in some other places, but we also occationally have checks to
> prevent recursing too far.

I think it does not give us any other new size/complexity limitation,
because we already have some of recursive walker functions which
consume stack more than applyColumnPrivsWalker() I proposed.

The applyColumnPrivsWalker() consumes its stack for a return address,
two pointers and an integer variables for each depth.
But, for example, existing check_ungrouped_columns_walker() consumes
it more.

In addition, please note that expression_tree_walker() invokes
check_stack_depth() to prevent unexpected stack overflow.

Thanks,

>> I strongly want the Column-level privileges to be get merged
>> as soon as possible, so I don't spare any possible assist
>> for his works.
> 
> Thanks so much for your help!  It's definitely appriciated.  I'm going
> to try and play with your patch today and probably add some additional
> regression tests and make sure everything works as expected.
> 
>     Thanks again!
> 
>         Stephen


-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: parallel restore
Next
From: KaiGai Kohei
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1389)