Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants
Date
Msg-id 24482.1218506038@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants
Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants
List pgsql-bugs
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> +     root->parse->rtable = list_union(root->parse->rtable, subquery->rtable);

That's one heck of a scary patch: nowhere in list_union's API is there
any guarantee that it preserves list ordering, but we *must not* change
the positions of the existing rtable entries.

I think it might be better to fix the problem in
pull_up_union_leaf_queries instead; given that it wasn't broken till
recently, I think it's arguably that function's fault.  Can we redesign
it to pull up everything in the subquery rtable, not just what was
referenced?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: return query with set-returning functions
Next
From: Tom Lane
Date:
Subject: Re: BUG #4350: 'select' acess given to views containing "union all" even though user has no grants