Get the latest tech news

Waiting for PostgreSQL 14: SEARCH and CYCLE clauses


On 1st of February 2021, Peter Eisentraut committed patch: SEARCH and CYCLE clauses This adds the SQL standard feature that adds the SEARCH and CYCLE clauses to recursive queries to be able to do produce breadth- or depth-first search orders and detect cycles. These clauses can be rewritten into queries using existing syntax, and that is what this patch does in the rewriter.

What's more – I didn't even had to add any condition on the is_cycle, it was sufficient that it's calculated, and processing stopped. And I can still add “WHERE is_cycle = false" to weed out the connections that cycle back to city that was already visited: All in all – both these things look amazing, and will greatly help writing queries for hierarchical data.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Search

Search

Photo of PostgreSQL

PostgreSQL

Photo of cycle

cycle

Related news:

News photo

Dblab: Interactive Terminal Client for PostgreSQL, MySQL, SQLite3 and Oracle

News photo

Google Cut Back AI Overviews in Search Even Before Its ‘Pizza Glue’ Fiasco

News photo

Google's Head of Search says those erroneous AI Overview results will be fixed