Try to stabilize output from rolenames regression test.
authorTom Lane <[email protected]>
Fri, 18 Sep 2020 01:02:55 +0000 (21:02 -0400)
committerTom Lane <[email protected]>
Fri, 18 Sep 2020 01:02:55 +0000 (21:02 -0400)
It's not quite clear why commit 45b980570 has resulted in
some instability here, though interference from concurrent
autovacuum runs seems like a reasonable guess.  What is
clear is that the output ordering of the test queries is
underdetermined for no very good reason.  Extend the
ORDER BY keys in hopes of fixing the buildfarm.

Discussion: https://postgr.es/m/147499.1600351924@sss.pgh.pa.us

src/test/modules/unsafe_tests/expected/rolenames.out
src/test/modules/unsafe_tests/sql/rolenames.sql

index 9636e50e05c8084cbfff2639f0cd801a5e86b29a..6ddb1a83f67b67dfc462d0a67486eefdcc6eae26 100644 (file)
@@ -1,4 +1,4 @@
-CREATE OR REPLACE FUNCTION chkrolattr()
+CREATE FUNCTION chkrolattr()
  RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
  AS $$
 SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@@ -13,9 +13,9 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
              ('None', '-'))
       AS v(uname, keyword)
       ON (r.rolname = v.uname)
- ORDER BY 1;
+ ORDER BY 1, 2;
 $$ LANGUAGE SQL;
-CREATE OR REPLACE FUNCTION chksetconfig()
+CREATE FUNCTION chksetconfig()
  RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
  AS $$
 SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@@ -31,14 +31,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
    WHERE (r.rolname) IN ('Public', 'current_user', 'regress_testrol1', 'regress_testrol2')
 ORDER BY 1, 2;
 $$ LANGUAGE SQL;
-CREATE OR REPLACE FUNCTION chkumapping()
+CREATE FUNCTION chkumapping()
  RETURNS TABLE (umname name, umserver name, umoptions text[])
  AS $$
 SELECT r.rolname, s.srvname, m.umoptions
  FROM pg_user_mapping m
  LEFT JOIN pg_roles r ON (r.oid = m.umuser)
  JOIN pg_foreign_server s ON (s.oid = m.umserver)
- ORDER BY 2;
+ ORDER BY 2, 1;
 $$ LANGUAGE SQL;
 --
 -- We test creation and use of these role names to ensure that the server
index 638decda6800f3941bd98ed674d1a86a1d3c2bf3..40dc86fdb9b3a63a80012f0b03922cf48752bd25 100644 (file)
@@ -1,4 +1,4 @@
-CREATE OR REPLACE FUNCTION chkrolattr()
+CREATE FUNCTION chkrolattr()
  RETURNS TABLE ("role" name, rolekeyword text, canlogin bool, replication bool)
  AS $$
 SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
@@ -13,10 +13,10 @@ SELECT r.rolname, v.keyword, r.rolcanlogin, r.rolreplication
              ('None', '-'))
       AS v(uname, keyword)
       ON (r.rolname = v.uname)
- ORDER BY 1;
+ ORDER BY 1, 2;
 $$ LANGUAGE SQL;
 
-CREATE OR REPLACE FUNCTION chksetconfig()
+CREATE FUNCTION chksetconfig()
  RETURNS TABLE (db name, "role" name, rolkeyword text, setconfig text[])
  AS $$
 SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
@@ -33,14 +33,14 @@ SELECT COALESCE(d.datname, 'ALL'), COALESCE(r.rolname, 'ALL'),
 ORDER BY 1, 2;
 $$ LANGUAGE SQL;
 
-CREATE OR REPLACE FUNCTION chkumapping()
+CREATE FUNCTION chkumapping()
  RETURNS TABLE (umname name, umserver name, umoptions text[])
  AS $$
 SELECT r.rolname, s.srvname, m.umoptions
  FROM pg_user_mapping m
  LEFT JOIN pg_roles r ON (r.oid = m.umuser)
  JOIN pg_foreign_server s ON (s.oid = m.umserver)
- ORDER BY 2;
+ ORDER BY 2, 1;
 $$ LANGUAGE SQL;
 
 --