Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql - Mailing list pgsql-hackers

From Amul Sul
Subject Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql
Date
Msg-id CAAJ_b95+De1PRHSeX_nbLcvMNqB0yEUB3Co7X2uzvquR299iCw@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 28, 2022 at 10:43 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.com> writes:
> > On Fri, 28 Oct 2022 at 16:51, Amul Sul <sulamul@gmail.com> wrote:
> >> If we
> >> are too sure that the output usually comes in the same order then the
> >> ORDER BY clause that exists in other tests seems useless. I am a bit
> >> confused & what could be a possible bug?
>
> > You can't claim that if this test shouldn't get an ORDER BY that all
> > tests shouldn't have an ORDER BY. That's just crazy. What if the test
> > is doing something like testing sort?!
>
> The general policy is that we'll add ORDER BY when a test is demonstrated
> to have unstable output order for identifiable environmental reasons
> (e.g. locale dependency) or timing reasons (e.g. background autovacuum
> sometimes changing statistics).  But the key word there is "identifiable".
> Without some evidence as to what's causing this, it remains possible
> that it's a code bug not the fault of the test case.
>
> regress.sgml explains the policy further:
>
>   You might wonder why we don't order all the regression test queries explicitly
>   to get rid of this issue once and for all.  The reason is that that would
>   make the regression tests less useful, not more, since they'd tend
>   to exercise query plan types that produce ordered results to the
>   exclusion of those that don't.
>

Understood. Thanks for the clarification.

Regards,
Amul



pgsql-hackers by date:

Previous
From: Amul Sul
Date:
Subject: Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql
Next
From: Bharath Rupireddy
Date:
Subject: Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?