Recursive function DDL results in an infinite loop
See original GitHub issuecreate type SomeThing {
create link child -> SomeThing;
};
create function get_all_children_ordered(parent: SomeThing) -> SET OF SomeThing
Using (SELECT SomeThing);
ALTER FUNCTION get_all_children_ordered(parent: SomeThing) USING ( SELECT parent.child UNION get_all_children_ordered(parent) );
results in
ERROR: InternalServerError: maximum recursion depth exceeded
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
15.00 - Preventing Infinite Recursion Due To Cyclic Data
Recursive views can recurse infinitely when there are cycles in the underlying data they are processing (as they can with acyclic data -...
Read more >Finite and Infinite Recursion with examples - GeeksforGeeks
The process in which a function calls itself directly or indirectly is called Recursion and the corresponding function is called a Recursive ......
Read more >recursive function going into infinite loop despite condition check
The proper fix is to use either a while loop or recursion (and then, probably return the value called by the recursive call)....
Read more >Using recursive queries - Db2 for i SQL - IBM
Db2 for i provides two ways of defining a recursive query. ... If you want results back and just want the infinite cycle...
Read more >4.8. Infinite Recursion — How to Think Like a Computer Scientist
In the examples in the previous section, notice that each time the functions get called recursively, the argument gets smaller by one, so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@adriangb, yes, the solution was to explicitly prohibit, which is better than crashing. Please open a new feature request if you’d like to see this implemented properly, ideally with some example use cases to help us better understand the need.
Just to clarify: the solution here was to prohibit defining recursive functions temporarily until the feature is implemented? If so maybe best o keep the issue open, or is there any other way I can track progress on this actually getting implemented?