diff --git a/src/test/regress/expected/insert.out b/src/test/regress/expected/insert.out
index 49f667b1194daf52f273f7f34ea6f179b4dce5a1..383d884847131d58d5012a05aa27838d8ed47555 100644
--- a/src/test/regress/expected/insert.out
+++ b/src/test/regress/expected/insert.out
@@ -314,7 +314,8 @@ from pg_attribute
 where attname = 'a'
  and (attrelid = 'p'::regclass
    or attrelid = 'p1'::regclass
-   or attrelid = 'p11'::regclass);
+   or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
  attrelid | attname | attnum 
 ----------+---------+--------
  p        | a       |      1
@@ -333,7 +334,4 @@ select tableoid::regclass, * from p;
 (1 row)
 
 -- cleanup
-drop table p cascade;
-NOTICE:  drop cascades to 2 other objects
-DETAIL:  drop cascades to table p1
-drop cascades to table p11
+drop table p, p1, p11;
diff --git a/src/test/regress/sql/insert.sql b/src/test/regress/sql/insert.sql
index 08dc068de8069c28e569263744ceede7d7da0bd8..687bd4b50411ee339c8d8b6f973bea1bc56cdd1b 100644
--- a/src/test/regress/sql/insert.sql
+++ b/src/test/regress/sql/insert.sql
@@ -185,7 +185,8 @@ from pg_attribute
 where attname = 'a'
  and (attrelid = 'p'::regclass
    or attrelid = 'p1'::regclass
-   or attrelid = 'p11'::regclass);
+   or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
 
 alter table p1 attach partition p11 for values from (2) to (5);
 alter table p attach partition p1 for values from (1, 2) to (1, 10);
@@ -195,4 +196,4 @@ insert into p values (1, 2);
 select tableoid::regclass, * from p;
 
 -- cleanup
-drop table p cascade;
+drop table p, p1, p11;