Re: Proposing WITH ITERATIVE

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposing WITH ITERATIVE
Date: 2020-04-29 21:59:27
Message-ID: CADUqk8UTAAsT_FQ85J2Xma9YbtA5y8f0SXyzpiWiR1_39ycfSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 29, 2020 at 5:54 PM Jonah H. Harris <jonah(dot)harris(at)gmail(dot)com>
wrote:

> On Wed, Apr 29, 2020 at 4:50 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
> wrote:
>
>> Having both WHERE and WHILE might look awkward.
>>>
>>
>> Maybe an UNTIL instead of WHILE?
>>
>
> While I'm not a huge fan of it, one of the other databases implementing
> this functionality does so using the syntax:
>
> WITH ITERATIVE R AS '(' R0 ITERATE Ri UNTIL N (ITERATIONS | UPDATES) ')' Qf
>
> Where N in ITERATIONS represents termination at an explicit count and, in
> UPDATES, represents termination after Ri updates more than n rows on table
> R.
>

Sent too soon :) One of the main reasons I dislike the above is that it
assumes N is known. In some cases, however, you really need termination
upon a condition.

--
Jonah H. Harris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2020-04-29 22:29:04 Re: Fixes for two separate bugs in nbtree VACUUM's page deletion
Previous Message Andres Freund 2020-04-29 21:55:59 Re: xid wraparound danger due to INDEX_CLEANUP false