pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid depending on post-UPDATE row order in float4/float8 tests.
Date: Tue, 22 Apr 2025 18:24:28 +0000
Message-ID: <E1u7IIG-001HoW-0H@gemulon.postgresql.org> (raw)

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.elfe@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.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(-)



Message-ID: <E1u7IIG-001HoW-0H@gemulon.postgresql.org>
Permalink:  ../E1u7IIG-001HoW-0H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u7IIG-001HoW-0H@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid depending on post-UPDATE row order in float4/float8 tests.
  In-Reply-To: <E1u7IIG-001HoW-0H@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox