Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql
Дата
Msg-id 1142439.1666934007@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql  (Amul Sul <sulamul@gmail.com>)
Список pgsql-hackers
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.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [PROPOSAL] : Use of ORDER BY clause in insert.sql
Следующее
От: David Rowley
Дата:
Сообщение: Re: Adding doubly linked list type which stores the number of items in the list