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 49669651.3090102@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>)
Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost wrote:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Stephen Frost <sfrost@snowman.net> writes:
>>> I'm open to suggestions about how to handle this.  My first thought
>>> would be- add an entry to the cols_sel list for the RTE that is special
>>> and indicates "any column", perhaps by using a '0' for the attrid, as is
>>> done elsewhere.  Then modify ExecCheckRTEPerms() to handle it.
>> Wouldn't it be sufficient to treat an empty cols_sel list that way?
> 
> I've thought about it some, and yes, that sounds reasonable.  I'll try
> and implement it tonight and test it out.

I also think it is a reasonable solution.

In addition, please note that the following case:

| postgres=# SELECT t1 FROM t1;
|    t1
| ---------
|  (1,aaa)
|  (2,bbb)
|  (3,ccc)

When we refer table-rowtype, analyzer handles its Var->varattno has
InvalidAttrNumber (=0). If SQL standard mention nothing, it is quite
natural to consider it refers whole of the user columns.

I think it can share the code to handle the above empty cols_sel cases.

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


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Proposal: new border setting in psql
Next
From: Greg Smith
Date:
Subject: Re: Improving compressibility of WAL files