Inherit regression outputs rows in alternative ordering when run on other table AM than heap

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Inherit regression outputs rows in alternative ordering when run on other table AM than heap
Date: 2026-03-27 12:54:25
Message-ID: CALT9ZEF8JA+h9+6r_cJFjR-us7KG=hWbM7GBC6SVrW3FpCDv8g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, hackers!

Existing inherit regression test results are tied to the particular
row order after UPDATE clause. The context is approximately the same
as in [1].

When run on different table AM it shows the following difference in output:

@@ -157,12 +157,12 @@
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
relname | aa
---------+----------
+ a | zzzzzz
a | zzzz
a | zzzzz
a | zzzzzz
a | zzzzzz
a | zzzzzz
- a | zzzzzz
b | bbb
b | bbbb
b | bbbbb
@@ -231,12 +231,12 @@
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
relname | aa
---------+--------
+ a | zzzzzz
a | zzzz
a | zzzzz
a | zzzzzz
a | zzzzzz
a | zzzzzz
- a | zzzzzz
(6 rows)

SELECT relname, b.* FROM ONLY b, pg_class where b.tableoid = pg_class.oid;
@@ -276,9 +276,9 @@
SELECT relname, a.* FROM a, pg_class where a.tableoid = pg_class.oid;
relname | aa
---------+----------
+ a | zzzzzz
a | zzzz
a | zzzzz
- a | zzzzzz
a | zzzzzz
a | zzzzzz
a | zzzzzz
@@ -350,12 +350,12 @@
SELECT relname, a.* FROM ONLY a, pg_class where a.tableoid = pg_class.oid;
relname | aa
---------+--------
+ a | zzzzzz
a | zzzz
a | zzzzz
a | zzzzzz
a | zzzzzz
a | zzzzzz
- a | zzzzzz
(6 rows)

This could be easily fixed by adding ORDER BY clause to the test. See
the patch proposed. I added order by not only to places prone to the
difference quoted but also to other places as it's cheap and doesn't
harm. If the committer don't agree with extra order by's I can leave
only those necessary for fixing quoted test output.

[1] https://github.com/postgres/postgres/commit/4c1a27e53a508f74883cda52a6c8612121d7fd6b

Attachment Content-Type Size
v1-0001-Stabilize-output-of-inherit-regression-test.patch application/octet-stream 21.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-03-27 12:55:41 Re: pg_plan_advice
Previous Message Nisha Moond 2026-03-27 12:37:56 Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?