BUG #13863: Select from views gives wrong results - Mailing list pgsql-bugs

From wrb@autistici.org
Subject BUG #13863: Select from views gives wrong results
Date
Msg-id 20160113183558.12989.56904@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13863: Select from views gives wrong results
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13863
Logged by:          W
Email address:      wrb@autistici.org
PostgreSQL version: 9.5.0
Operating system:   Mac OS X 10.11.2 (postgres is from homebrew)
Description:

Hello,

I noticed strange behavior while using views with the new grouping sets
functionality.

Steps to reproduce are here:
https://gist.github.com/wrb/a73f45dcd335c8bc166c

On my machine, selecting from view gives zero results while selecting from
materialize view (or using CTE) gives the correct result. There's nothing
unusual in log.

Looking at explain analyze function, it seems that the filter is pushed too
deep and removes rows from the original table and not from the aggreage. It
works correctly when using CTE.

Thanks!

pgsql-bugs by date:

Previous
From: y.chaitanya@tcs.com
Date:
Subject: BUG #13862: Duplicated rows for a table with primary key
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #13862: Duplicated rows for a table with primary key