Stephen Frost wrote:
> * Tom Lane (t...@sss.pgh.pa.us) wrote:
>> Stephen Frost <sfr...@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 <kai...@ak.jp.nec.com>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to