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

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint
Date: 2013-05-07 23:04:19
Message-ID: CAM-w4HM6KWQzM2mob+q92qS8ASFp9MyPVfaG-CcEionPvitQFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, May 7, 2013 at 6:59 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2013-05-08 01:24:33 pgsql: doc: Add IDs to link targets used by phpPgAdmin
Previous Message Tom Lane 2013-05-07 17:59:37 Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint

Browse pgsql-hackers by date

  From Date Subject
Next Message Robins Tharakan 2013-05-07 23:26:56 Re: Patch to add regression tests for SCHEMA
Previous Message Robins Tharakan 2013-05-07 22:40:11 Re: Add some regression tests for SEQUENCE