SEARCH and CYCLE clauses
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-20T11:46:18Z
Lists: pgsql-hackers
Attachments
- v1-0001-SEARCH-and-CYCLE-clauses.patch (text/plain) patch v1-0001
I have implemented the SEARCH and CYCLE clauses. This is standard SQL syntax attached to a recursive CTE to compute a depth- or breadth-first ordering and cycle detection, respectively. This is just convenience syntax for what you can already do manually. The original discussion about recursive CTEs briefly mentioned these as something to do later but then it was never mentioned again. SQL specifies these in terms of syntactic transformations, and so that's how I have implemented them also, mainly in the rewriter. I have successfully tested this against examples I found online that were aimed at DB2. The contained documentation and the code comment in rewriteHandler.c explain the details. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Enhanced cycle mark values
- f4adc41c4f92 14.0 landed
-
SEARCH and CYCLE clauses
- 3696a600e229 14.0 landed
-
doc: Expand recursive query documentation
- 323ae003e464 14.0 landed
-
Adjust cycle detection examples and tests
- 3fb676504da9 14.0 landed