Re: Remove restrictions in recursive query
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Renan Alves Fonseca <renanfonseca@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-03-27T16:39:55Z
Lists: pgsql-hackers
On Thu, Mar 27, 2025 at 12:37 PM Robert Haas <robertmhaas@gmail.com> wrote: > It's not a problem if UNION ALL is used within the initial_query and > it's not a problem if UNION ALL is used within the iterated_query. But > you can't apply ORDER BY to the result of the UNION, because the UNION > is kind of fake -- we're not running the UNION as a single query, > we're running the two halves separately, the first once and the second > as many times as needed. Oops. The two UNION ALL references in the first part of this paragraph should have said ORDER BY. -- Robert Haas EDB: http://www.enterprisedb.com