diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out
index 7e8f57213038a367a914a3a7b20544425ef6a0a7..6ef1cbdec7972a1d32a6fe2d1c6f1a227eb84f1c 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -601,7 +601,7 @@ create table p1(ff1 int);
 alter table only p1 add constraint p1chk check (ff1 > 0);
 alter table p1 add constraint p2chk check (ff1 > 10);
 -- conisonly should be true for ONLY constraint
-select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.conisonly from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname = 'p1';
+select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.conisonly from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname = 'p1' order by 1,2;
  relname | conname | contype | conislocal | coninhcount | conisonly 
 ---------+---------+---------+------------+-------------+-----------
  p1      | p1chk   | c       | t          |           0 | t
diff --git a/src/test/regress/sql/inherit.sql b/src/test/regress/sql/inherit.sql
index 4dfbc07f94f10bf32d4f9191b7bbad55d6117662..6fdbd18c25173dab58c069b8a93a7bf86e7a716e 100644
--- a/src/test/regress/sql/inherit.sql
+++ b/src/test/regress/sql/inherit.sql
@@ -143,7 +143,7 @@ create table p1(ff1 int);
 alter table only p1 add constraint p1chk check (ff1 > 0);
 alter table p1 add constraint p2chk check (ff1 > 10);
 -- conisonly should be true for ONLY constraint
-select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.conisonly from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname = 'p1';
+select pc.relname, pgc.conname, pgc.contype, pgc.conislocal, pgc.coninhcount, pgc.conisonly from pg_class as pc inner join pg_constraint as pgc on (pgc.conrelid = pc.oid) where pc.relname = 'p1' order by 1,2;
 
 -- Test that child does not inherit ONLY constraints
 create table c1 () inherits (p1);