diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index aecdf85d73a2f52b4617181fe46cd2817983766e..f0990ea7344f64a29ae33cc1f07519bf5527fedb 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -858,7 +858,7 @@ select * from rtest_view3;
 
 delete from rtest_view3;
 insert into rtest_view4 select * from rtest_vview4 where 3 > refcount;
-select * from rtest_view4;
+select * from rtest_view4 order by a, b;
  a |   b    | c 
 ---+--------+---
  2 | item 2 | 2
@@ -868,7 +868,7 @@ select * from rtest_view4;
 
 delete from rtest_view4;
 insert into rtest_view4 select * from rtest_vview5 where a > 2 and refcount = 0;
-select * from rtest_view4 order by a, b;
+select * from rtest_view4;
  a |   b    | c 
 ---+--------+---
  3 | item 3 | 0
diff --git a/src/test/regress/sql/rules.sql b/src/test/regress/sql/rules.sql
index 0a630194f2769d4ff63f1ca8c263b9f68ceabd62..3179a851ebb482b740b678a291ef78297c700c23 100644
--- a/src/test/regress/sql/rules.sql
+++ b/src/test/regress/sql/rules.sql
@@ -467,11 +467,11 @@ select * from rtest_view3;
 delete from rtest_view3;
 
 insert into rtest_view4 select * from rtest_vview4 where 3 > refcount;
-select * from rtest_view4;
+select * from rtest_view4 order by a, b;
 delete from rtest_view4;
 
 insert into rtest_view4 select * from rtest_vview5 where a > 2 and refcount = 0;
-select * from rtest_view4 order by a, b;
+select * from rtest_view4;
 delete from rtest_view4;
 --
 -- Test for computations in views