Skip to content

Commit b059d91

Browse files
ritanwarshardgupta
authored andcommitted
[BABEL-5675] Fix babelfish dumpall after community 16eff4261f
Community commit 16eff4261f changed query to fetch role membership which is duplicated in dumpall_babel_utils.c file so this commit updates the duplicated query accordingly. cr: https://code.amazon.com/reviews/CR-183285048
1 parent afb03cb commit b059d91

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bin/pg_dump/dumpall_babel_utils.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,10 @@ getBabelfishRoleMembershipQuery(PGconn *conn, PQExpBuffer buf,
397397

398398
appendPQExpBufferStr(buf, "SELECT ur.rolname AS role, "
399399
"um.rolname AS member, "
400-
"ug.oid AS grantorid, "
401400
"ug.rolname AS grantor, "
401+
"a.roleid AS roleid, "
402+
"a.member AS memberid, "
403+
"a.grantor AS grantorid, "
402404
"a.admin_option");
403405

404406
if (dump_grant_options)
@@ -407,8 +409,8 @@ getBabelfishRoleMembershipQuery(PGconn *conn, PQExpBuffer buf,
407409
appendPQExpBuffer(buf, " FROM pg_auth_members a "
408410
"INNER JOIN bbf_roles ur on ur.oid = a.roleid "
409411
"INNER JOIN bbf_roles um on um.oid = a.member "
410-
"LEFT JOIN bbf_roles ug on ug.oid = a.grantor "
412+
"LEFT JOIN %s ug on ug.oid = a.grantor "
411413
"WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '^pg_') "
412414
"AND NOT (ur.rolname IN %s AND um.rolname IN %s) "
413-
"ORDER BY 1,2,4", default_bbf_roles, default_bbf_roles);
415+
"ORDER BY 1,2,3", role_catalog, default_bbf_roles, default_bbf_roles);
414416
}

0 commit comments

Comments
 (0)