Explore the new SEARCH and CYCLE features in PostgreSQLĀ® 14
PostgreSQL 14 introduces new features CYCLE and SEARCH, which simplify the writing of recursive queries. This article demonstrates how to use these features in a travel planning scenario. The author creates a database with tables for cities and trips, then uses recursive queries to plan a journey within a budget. The SEARCH option allows users to define the exploration path based on the number of stops or the trip path, while the CYCLE option helps avoid loops. Finally, the article shows how to factor in return trips to Rome using additional joins and conditions.
Company
Aiven
Date published
Dec. 14, 2021
Author(s)
Francesco Tisiot
Word count
2913
Hacker News points
1
Language
English