Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint
Date
Msg-id CAM-w4HM6KWQzM2mob+q92qS8ASFp9MyPVfaG-CcEionPvitQFQ@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, May 7, 2013 at 6:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The main downside of this
> is that fully dummy appendrels (those with no live children at all,
> such as in your example) wouldn't be recognized by IS_DUMMY_PATH,
> so the quality of planning in the outer query would be slightly
> degraded.  But such cases are probably sufficiently unusual that this
> might be an okay price to pay for a back branch

That's kind of dismaying. ORMs have a tendency to create queries like
this and people may have even written such queries by hand and tested
them to determine that postgres was able to exclude the useless
relation. To have them install a security update and discover that
something they had previously tested no longer worked would be
annoying.

If we just reverted your fix and didn't fix it in 9.2 that would also
fix the crash right? The bug was only that it leaked the fact that the
view was provably empty from the definition? But it's been that way
for a long time and after all:

xxx=> select * from pg_views where viewname = 'v';schemaname | viewname | viewowner |   definition
------------+----------+-----------+----------------public     | v        | stark     |  SELECT 1     +           |
    |           |   WHERE false;
 
(1 row)

-- 
greg



pgsql-hackers by date:

Previous
From: Robins Tharakan
Date:
Subject: Re: Add some regression tests for SEQUENCE
Next
From: Robins Tharakan
Date:
Subject: Re: Patch to add regression tests for SCHEMA