Re: pgsql: Add regression test for bug fixed by recent refactoring.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Kevin Grittner <kgrittn(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add regression test for bug fixed by recent refactoring.
Date: 2013-05-01 02:14:42
Message-ID: 18583.1367374482@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Kevin Grittner <kgrittn(at)postgresql(dot)org> writes:
> Add regression test for bug fixed by recent refactoring.
> Test case by Andres Freund for bug fixed by Tom Lane's refactoring
> in commit 5194024d72f33fb209e10f9ab0ada7cc67df45b7

Hm, that actually has got nothing much to do with matviews:

regression=# create view vv1 as select false;
CREATE VIEW
regression=# create view vv2 as select false where false;
CREATE VIEW
regression=# create user joe;
CREATE ROLE
regression=# \c - joe
You are now connected to database "regression" as user "joe".
regression=> select * from vv1;
ERROR: permission denied for relation vv1
regression=> select * from vv2;
bool
------
(0 rows)

Of course the select from vv2 should fail as well, but it doesn't,
because vv2 is nowhere to be seen in the rangetable passed to the
executor. I think the planner is probably trashing the rangetable
once it realizes that the query is completely dummy; but this is wrong
because we need to leave view rangetable entries behind for permissions
checks, even when they're unreferenced in the finished plan.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2013-05-01 10:25:13 Re: [COMMITTERS] pgsql: Make fast promotion the default promotion mode.
Previous Message Kevin Grittner 2013-04-30 20:06:52 pgsql: Add regression test for bug fixed by recent refactoring.

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-05-01 08:57:50 [PATCH] add --throttle to pgbench (submission 3)
Previous Message Greg Stark 2013-05-01 01:28:59 Re: Should pg_upgrade use --quote-all-identifiers?