Re: Proposing WITH ITERATIVE - Mailing list pgsql-hackers

From Jonah H. Harris
Subject Re: Proposing WITH ITERATIVE
Date
Msg-id CADUqk8X_RAAXiugxtzW7_BufTbsbyp9URpXan06Gjnth53au+w@mail.gmail.com
Whole thread Raw
In response to Re: Proposing WITH ITERATIVE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Proposing WITH ITERATIVE
List pgsql-hackers
On Wed, Apr 29, 2020 at 7:22 AM Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
Yeah the RECURSIVE vs ITERATIVE is a bit of a red herring here.  As you
say, the RECURSIVE keyword doesn't specify the processing but marks the
fact that the specification of the query is recursive.

Agreed. I started thinking through Fabien's response last night.

I think a syntax that would fit better within the existing framework
would be something like

WITH RECURSIVE t AS (
     SELECT base case
   REPLACE ALL  -- instead of UNION ALL
     SELECT recursive case
)

I was originally thinking more along the lines of Fabien's approach, but this is similarly interesting.

--
Jonah H. Harris

pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays
Next
From: Antonin Houska
Date:
Subject: Accidental use of the PVC_RECURSE_WINDOWFUNCS flag?