From: Tom Lane Date: Wed, 25 Feb 2026 15:51:42 +0000 (-0500) Subject: Stabilize output of new isolation test insert-conflict-do-update-4. X-Git-Tag: REL_18_4~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeaf2fc0ddbfb1e4a706555e33d9b4165d110a1c;p=thirdparty%2Fpostgresql.git Stabilize output of new isolation test insert-conflict-do-update-4. The test added by commit 4b760a181 assumed that a table's physical row order would be predictable after an UPDATE. But a non-heap table AM might produce some other order. Even with heap AM, the assumption seems risky; compare a3fd53bab for instance. Adding an ORDER BY is cheap insurance and doesn't break any goal of the test. Author: Pavel Borisov Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CALT9ZEHcE6tpvumScYPO6pGk_ASjTjWojLkodHnk33dvRPHXVw@mail.gmail.com Backpatch-through: 14 --- diff --git a/src/test/isolation/expected/insert-conflict-do-update-4.out b/src/test/isolation/expected/insert-conflict-do-update-4.out index 6e96e0d12da..80af2798a94 100644 --- a/src/test/isolation/expected/insert-conflict-do-update-4.out +++ b/src/test/isolation/expected/insert-conflict-do-update-4.out @@ -12,11 +12,11 @@ step insert1: INSERT INTO upsert VALUES (1, 11, 111) step update2a: UPDATE upsert SET i = i + 10 WHERE i = 1; step c2: COMMIT; step insert1: <... completed> -step select1: SELECT * FROM upsert; +step select1: SELECT * FROM upsert ORDER BY i; i| j| k --+--+--- -11|10|100 1|11|111 +11|10|100 (2 rows) step c1: COMMIT; @@ -33,7 +33,7 @@ step insert1: INSERT INTO upsert VALUES (1, 11, 111) step update2b: UPDATE upsert SET i = i + 150 WHERE i = 1; step c2: COMMIT; step insert1: <... completed> -step select1: SELECT * FROM upsert; +step select1: SELECT * FROM upsert ORDER BY i; i| j| k ---+--+--- 1|11|111 @@ -54,7 +54,7 @@ step insert1: INSERT INTO upsert VALUES (1, 11, 111) step delete2: DELETE FROM upsert WHERE i = 1; step c2: COMMIT; step insert1: <... completed> -step select1: SELECT * FROM upsert; +step select1: SELECT * FROM upsert ORDER BY i; i| j| k -+--+--- 1|11|111 diff --git a/src/test/isolation/specs/insert-conflict-do-update-4.spec b/src/test/isolation/specs/insert-conflict-do-update-4.spec index 6297b1d1d6c..a62531660d3 100644 --- a/src/test/isolation/specs/insert-conflict-do-update-4.spec +++ b/src/test/isolation/specs/insert-conflict-do-update-4.spec @@ -23,7 +23,7 @@ session s1 setup { BEGIN ISOLATION LEVEL READ COMMITTED; } step insert1 { INSERT INTO upsert VALUES (1, 11, 111) ON CONFLICT (i) DO UPDATE SET k = EXCLUDED.k; } -step select1 { SELECT * FROM upsert; } +step select1 { SELECT * FROM upsert ORDER BY i; } step c1 { COMMIT; } session s2