Re: BUG #13863: Select from views gives wrong results

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Andres Freund <andres(at)anarazel(dot)de>, wrb <wrb(at)autistici(dot)org>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13863: Select from views gives wrong results
Date: 2016-01-18 20:06:54
Message-ID: CAEZATCW1UtC7duDX6Bcf+7A26Ug3SDJTQrLfuqx3hH-u-fQ-vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 18 January 2016 at 12:54, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> Obvious question is, can we keep the optimization in the case that the
> qual is strict? and if so, should we?
>

Perhaps. I don't think it's entirely obvious what it means for a qual
to be strict.

I think that it would have to be the case that for every nullable
expression (every expression appearing in at least one grouping set,
but not appearing in all the grouping sets) the qual would have to be
provably false or null when that expression was null, or the qual
would have to be independent of that expression.

That seems like a pretty tricky piece of code to get right. It might
be more reasonable if you limited yourself to the case where all the
expressions were Vars, then you could use find_nonnullable_vars().

Regards,
Dean

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2016-01-19 00:47:02 Re: Re[2]: [BUGS] BUG #13869: Right Join query that never ends
Previous Message Igal @ Lucee.org 2016-01-18 18:20:24 Re: BUG #13859: pg_upgrade permissions on Windows