Valery Popov <v.popov@postgrespro.ru> writes:
> 28.10.2015 16:33, Tom Lane �����:
>> The standard way of dealing with that is to include logic in the query to
>> limit the recursion depth, for example ...
> 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.
Sure, but you can do that at the SQL level if you have a mind to, as well.
In practice, I think people tend to use recursive queries mainly for data
layouts where the maximum recursion depth isn't terribly clear, so that
setting this GUC to a useful value would be a difficult task anyway.
If you end up setting it to 100X or 1000X more than you think your queries
could possibly recurse, you might as well use some other approach like
statement_timeout, which has got a closer relationship to what you care
about, ie how long you want to wait.
regards, tom lane