pgsql: Avoid depending on post-UPDATE row order in float4/float8 tests.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid depending on post-UPDATE row order in float4/float8 tests.
Date: 2025-04-22 18:24:28
Message-ID: E1u7IIG-001HoW-0H@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid depending on post-UPDATE row order in float4/float8 tests.

While heapam reproduces the insertion order of rows well, updates
can move rows to varying places depending on autovacuum activity.
In most regression tests we've guarded against getting variable
results due to that, but float4.sql and float8.sql had escaped
notice so far because they update tables that are too small for
autovacuum to pay attention to.

With increasing interest in non-heap table AMs, it seems worth
allowing for update behaviors that are not like heapam's. Hence,
add ORDER BY to stabilize the results in case the updates put
the rows in a different order. (We'll continue to assume that a
seqscan will reproduce original insertion order, though. Removing
that assumption would require vastly-more-invasive test changes.)

Author: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/CALT9ZEExHAnBoBVQzQuWPMKUbapF5-FBO3fdeYG3s2tuWQz1NQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/da83b1ea10c2b7937d4c9e922465321749c6785b

Modified Files
--------------
src/test/regress/expected/float4-misrounded-input.out | 8 ++++----
src/test/regress/expected/float4.out | 8 ++++----
src/test/regress/expected/float8.out | 8 ++++----
src/test/regress/sql/float4.sql | 2 +-
src/test/regress/sql/float8.sql | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-04-22 19:10:55 pgsql: Re-enable SSL connect_fails tests, and fix related race conditio
Previous Message Tom Lane 2025-04-22 17:56:38 pgsql: gen_node_support.pl: improve error message for unclosed struct.