28.10.2015 16:33, Tom Lane пишет:
> Valery Popov <v(dot)popov(at)postgrespro(dot)ru> writes:
>> Recursive queries are typically used to deal with hierarchical or
>> tree-structured data.
>> In some conditions when data contain relationships with cycles recursive query will loop
>> unlimited and significantly slows the client's session.
> The standard way of dealing with that is to include logic in the query to
> limit the recursion depth, for example
>
> WITH RECURSIVE t(n) AS (
> SELECT 1
> UNION ALL
> SELECT n+1 FROM t WHERE n < 10
> )
> SELECT n FROM t;
>
Yes, I agree with this thesis. But I think in some cases would be
better to receive error message and stop execution than results will
incomplete.
--
Regards,
Valery Popov
Postgres Professional http://www.postgrespro.com
The Russian Postgres Company