On Thu, May 23, 2019 at 1:01 PM Jonathan S. Katz <jk...@postgresql.org> wrote:
> On 5/23/19 1:45 AM, David Rowley wrote: > > On Thu, 23 May 2019 at 15:31, Jonathan S. Katz <jk...@postgresql.org> > wrote: > >> Attached is > >> v3 of the patch, along with a diff. > > > > Minor details, but this query is not valid: > > > >> WITH c AS MATERIALIZED ( > >> SELECT * FROM a WHERE a.x % 4 > >> ) > >> SELECT * FROM c JOIN d ON d.y = a.x; > > > > a.x % 4 is not a boolean clause, and "a" is not in the main query, so > > a.x can't be referenced there. > > ...that's the only gotcha I'm actually embarrassed about. Fixed. > > The ON d.y = a.x still needs to be changed to ON d.y = c.x Pantelis