Re: Remove restrictions in recursive query

From: Renan Alves Fonseca <renanfonseca(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove restrictions in recursive query
Date: 2025-03-27 18:21:27
Message-ID: CAN_p2QhfY8U8=J518tqtoVcP+cP4As=oSVoB=eh7ss783Ga+UQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 27, 2025 at 7:10 PM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> There is distinct behavior between group by and order by here. You seem to be mixing them up.
>
> From Select:
>
> select_statement is any SELECT statement without an ORDER BY, LIMIT, FOR NO KEY UPDATE, FOR UPDATE, FOR SHARE, or FOR KEY SHARE clause. (ORDER BY and LIMIT can be attached to a subexpression if it is enclosed in parentheses. Without parentheses, these clauses will be taken to apply to the result of the UNION, not to its right-hand input expression.)
>
> This is the exact same parsing precedence order by is being given in the recursive CTE query situation presented earlier.
>
> David J.
>

You're right. I'm really mixing these 2 here. Thanks for the clarification.

I'll assume that the silence about allowing GROUP BY means it is not a
great idea...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-03-27 18:26:40 Re: Proposal: Progressive explain
Previous Message David G. Johnston 2025-03-27 18:09:45 Re: Remove restrictions in recursive query