Re: New patch for Column-level privileges

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Markus Wanner <markus(at)bluegap(dot)ch>, Alex Hunsaker <badalex(at)gmail(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New patch for Column-level privileges
Date: 2009-01-13 15:11:41
Message-ID: 26293.1231859501@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * KaiGai Kohei (kaigai(at)ak(dot)jp(dot)nec(dot)com) wrote:
>> - The markColumnForSelectPriv() uses walker function internally, because
>> there is no guarantee all the entities within RangeTblEntry->joinaliasvars
>> are Var type node.

> If any of them aren't Vars, then wouldn't it be a subselect or similar,

They're either Vars or COALESCEs of two Vars (the latter only for FULL
JOIN USING join columns). There are no other possibilities at parse
time. It might be best to use expression_tree_walker to avoid
explicitly handling the COALESCE case, but it's probably not going to be
any shorter.

You will need recursion of some type there, since it's entirely
possible for those Vars to point to another JOIN RTE.

BTW, another corner case that I'm not sure gets handled right is
that the join columns in JOIN USING or NATURAL JOIN need to be marked
as requiring ACL_SELECT. (Or so I'd expect anyway; I didn't run through
the SQL spec looking for chapter and verse on that.) I forget whether
we take any shortcuts in setting up the implied join condition
expressions, but if we do then some extra code might be needed. This
would be a good place for a regression test in any case.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-13 15:23:16 Re: New patch for Column-level privileges
Previous Message Gregory Stark 2009-01-13 15:03:08 Re: Recovery Test Framework