Re: Second RewriteQuery complains about first RewriteQuery in edge case - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Second RewriteQuery complains about first RewriteQuery in edge case
Date
Msg-id CAEZATCWmpX00t3014D71j_Zr-yh-vs7Utwn1Bbb1q7Sdg58mnQ@mail.gmail.com
Whole thread Raw
In response to Re: Second RewriteQuery complains about first RewriteQuery in edge case  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Second RewriteQuery complains about first RewriteQuery in edge case
List pgsql-hackers
On Thu, 27 Nov 2025 at 17:55, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> On Thu, 27 Nov 2025 at 16:55, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >
> > I do think there's another way we could attack it.  Similarly
> > to the way VALUES RTEs are either processed or skipped by
> > checking the rangetable length, we could pass down the length
> > of the outer query's cteList, and assume that the last N entries
> > in a product query's cteList have already been processed.
> > (Last N not first N because of the order in which the lists are
> > concatenated at line 596.)  Maybe that's too fragile, but the
> > approach seems to have worked all right for VALUES.
>

Here's an update, doing it that way. It does appear somewhat neater.

Regards,
Dean

Attachment

pgsql-hackers by date:

Previous
From: Mihail Nikalayeu
Date:
Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Next
From: Matthias van de Meent
Date:
Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements