On Jul 11, 2025 at 23:57 +0800, Tom Lane <t...@sss.pgh.pa.us>, wrote:
> "David G. Johnston" <david.g.johns...@gmail.com> writes:
> > On Friday, July 11, 2025, Zhang Mingli <zmlpostg...@gmail.com> wrote:
> > > So, are both result sets technically correct given the absence of an ORDER
> > > BY clause?
>
> > The system is behaving within the requirements of the specification. The
> > query itself is bugged code that the query author should fix.
>
> Well, it's our own regression-test query. I think the actual question
> being asked here is "do our regression tests need to pass under random
> non-default GUC settings?". I'd say no; it'd be next door to
> impossible to guarantee that.
Hi, I didn't mean to imply that our regression tests should pass under random 
non-default GUC settings.
My concern arose from the development of our distributed databases, such as 
Greenplum and Apache Cloudberry.
In Postgres, the tuple order remains stable under constant GUC settings(Index 
Scan, SeqScan and there is no Parallel Seqscan for Window Agg).
However, in a distributed environment, tuples are spread across segments, and 
the order in which data is returned to the Master node can be unpredictable.
This unpredictability can affect the stability of results when calculating 
window functions.
I just wanted to confirm that both results are correct in the absence of an 
"ORDER BY" clause. I believe I've received the clarification I needed.
Thank you all!

--
Zhang Mingli
HashData

Reply via email to