Home / Companies / Yugabyte / Blog / Post Details
Content Deep Dive

Using the PostgreSQL Recursive CTE – Part One

Blog post from Yugabyte

Post Details
Company
Date Published
Author
Bryn Llewellyn
Word Count
3,217
Company Posts That Month
8
Language
English
Hacker News Points
-
Post removed?
No
Summary

The text discusses the use of PostgreSQL's recursive common table expression (CTE) to traverse hierarchical data and solve problems like the "Bacon Numbers" problem. It explains how YugabyteDB, a distributed SQL database, re-uses the PostgreSQL source code to provide SQL and stored procedure functionality. The author uses examples, including an employee hierarchy and the Bacon Numbers problem, to illustrate the use of recursive CTEs in solving these types of problems. The text also covers the syntax and semantics of the WITH clause and common table expressions (CTEs) in YugabyteDB's YSQL documentation. It provides code snippets and explanations of how to implement recursive CTEs using YugabyteDB's YSQL, including examples of breadth-first and depth-first traversals of a hierarchy. The author concludes that the power of PostgreSQL's recursive CTE is awe-inspiring and invites readers to learn more in Part Two.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.