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

Explore the new SEARCH and CYCLE features in PostgreSQL® 14

Blog post from Aiven

Post Details
Company
Date Published
Author
Francesco Tisiot
Word Count
2,913
Language
English
Hacker News Points
1
Summary

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.