Fix test case from b0c5b215d.
authorTom Lane <[email protected]>
Tue, 30 Apr 2024 00:23:26 +0000 (20:23 -0400)
committerTom Lane <[email protected]>
Tue, 30 Apr 2024 00:23:26 +0000 (20:23 -0400)
I'd not checked that this iteration of the test actually worked
with a bootstrap superuser not named 'postgres'.  It didn't,
because the coercion rules for CASE caused us to try to cast
the 'postgres' literal to regrole.  Mea culpa.

Per buildfarm (via Alexander Korotkov)

Discussion: https://postgr.es/m/CAPpHfdsV=iTvH6B858hnH1bLgewYH6cdTnO_eOOw9EOa8kehkA@mail.gmail.com

src/test/modules/test_pg_dump/expected/test_pg_dump.out
src/test/modules/test_pg_dump/sql/test_pg_dump.sql

index fcfa78aafc083bd2366063feec5d466c7fc76b68..dc493e5be26e9ea97a07a2bd84fba48e979198ac 100644 (file)
@@ -65,9 +65,9 @@ GRANT USAGE ON TYPE test_pg_dump_e1 TO regress_dump_test_role;
 -- Substitute for current user's name to keep test output consistent
 SELECT s.obj,
   CASE WHEN a.grantor::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantor::regrole END,
+    ELSE a.grantor::regrole::name END,
   CASE WHEN a.grantee::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantee::regrole END,
+    ELSE a.grantee::regrole::name END,
   a.privilege_type, a.is_grantable
 FROM
   (SELECT pg_describe_object(classoid,objoid,objsubid) AS obj, initprivs
@@ -202,9 +202,9 @@ DROP OWNED BY regress_dump_test_role RESTRICT;
 -- Substitute for current user's name to keep test output consistent
 SELECT s.obj,
   CASE WHEN a.grantor::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantor::regrole END,
+    ELSE a.grantor::regrole::name END,
   CASE WHEN a.grantee::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantee::regrole END,
+    ELSE a.grantee::regrole::name END,
   a.privilege_type, a.is_grantable
 FROM
   (SELECT pg_describe_object(classoid,objoid,objsubid) AS obj, initprivs
index 41f1d8dfc5c7c08b7a41fbee9f623df791680367..48e99bb5ccd8645538d7a77d3c3b1c96292016e0 100644 (file)
@@ -78,9 +78,9 @@ GRANT USAGE ON TYPE test_pg_dump_e1 TO regress_dump_test_role;
 -- Substitute for current user's name to keep test output consistent
 SELECT s.obj,
   CASE WHEN a.grantor::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantor::regrole END,
+    ELSE a.grantor::regrole::name END,
   CASE WHEN a.grantee::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantee::regrole END,
+    ELSE a.grantee::regrole::name END,
   a.privilege_type, a.is_grantable
 FROM
   (SELECT pg_describe_object(classoid,objoid,objsubid) AS obj, initprivs
@@ -130,9 +130,9 @@ DROP OWNED BY regress_dump_test_role RESTRICT;
 -- Substitute for current user's name to keep test output consistent
 SELECT s.obj,
   CASE WHEN a.grantor::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantor::regrole END,
+    ELSE a.grantor::regrole::name END,
   CASE WHEN a.grantee::regrole::name = current_user THEN 'postgres'
-    ELSE a.grantee::regrole END,
+    ELSE a.grantee::regrole::name END,
   a.privilege_type, a.is_grantable
 FROM
   (SELECT pg_describe_object(classoid,objoid,objsubid) AS obj, initprivs