Fix test case from b0c5b215d.

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
pull/160/head
Tom Lane 1 year ago
parent b0c5b215da
commit 9d9ece4c16
  1. 8
      src/test/modules/test_pg_dump/expected/test_pg_dump.out
  2. 8
      src/test/modules/test_pg_dump/sql/test_pg_dump.sql

@ -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

@ -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

Loading…
Cancel
Save