Re: Re: Should we have an optional limit on the recursion depth of recursive CTEs?

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Should we have an optional limit on the recursion depth of recursive CTEs?
Date: 2011-08-20 15:55:57
Message-ID: CAEYLb_XJjwYEX6gYYOP8y-2wzJOkzng3_tiTqvrnrP-zcrz+xg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20 August 2011 15:34, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Actually, using UNION instead of UNION ALL does prevent some infinite
> loops:

While that is worth pointing out, it cannot be recommended as a way of
preventing infinite recursion; after all, all 5 WITH RECURSIVE
examples in the docs use UNION ALL. It's just a different way of
specifying a terminating condition that isn't likely to be applicable
to more complicated rCTEs.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey E. Koposov 2011-08-20 16:50:21 Re: two index bitmap scan of a big table & hash_seq_search
Previous Message Bruce Momjian 2011-08-20 14:34:39 Re: Re: Should we have an optional limit on the recursion depth of recursive CTEs?