Re: Fortify float4 and float8 regression tests by ordering test results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fortify float4 and float8 regression tests by ordering test results
Date: 2025-04-22 14:23:28
Message-ID: 970263.1745331808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> writes:
> It's not a big problem, but propose a simple fix for the tests. It
> just adds ORDER BY 1 to all relevant float4 and floa8 queries.

You do realize that this problem is hardly confined to the
float4 and float8 tests? To a first approximation, a table AM
that fails to preserve insertion order would break every single
one of our regression tests. (I speak from experience, as
Salesforce had to deal with this when I was there...)

The reason why we don't simply add ORDER BY to everything is
explained at [1]:

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.

At some point we will probably have to think through what we
want to do about running the regression tests with table AMs that
don't wish to preserve ordering as much as heapam does. It's going
to need careful balancing of multiple concerns, and I don't think
"blindly slap ORDER BY everywhere" is going to be an acceptable
answer.

regards, tom lane

[1] https://www.postgresql.org/docs/devel/regress-evaluation.html#REGRESS-EVALUATION-ORDERING-DIFFERENCES

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-04-22 14:26:15 Re: Cygwin support
Previous Message Andrew Dunstan 2025-04-22 14:22:55 Re: Cygwin support