A Different Type of SQL Recursion with PostgreSQL

PostgreSQL offers a powerful procedural programming model that can be combined with standard SQL to solve complex data problems. This article demonstrates a procedural approach to a problem where a function needs to return all related tables for a given table name, including the level of relation. The first solution uses recursive common-table queries, while the second solution uses a procedural programming approach with normal function recursion. The article compares and discusses the pros and cons of both approaches, highlighting that the procedural approach may be more familiar and comfortable for developers.

https://github.com/vb-consulting/blog/discussions/1

To top