Skip to content

Commit

Permalink
Some fixes for db_owner role (#514)
Browse files Browse the repository at this point in the history
This commit changes the suffix for internally associated role from
"_obj" to "_bbfobj" for users that are member of db_owner role. This is
done to reduce the chance of an internal name clash.

Task: BABEL-4899, BABEL-5491, BABEL-5502

Signed-off-by: Sharu Goel <[email protected]>
  • Loading branch information
thephantomthief authored Jan 7, 2025
1 parent ce85137 commit 5752aad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/pg_dump/dumpall_babel_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ getBabelfishRolesQuery(PGconn *conn, PQExpBuffer buf, char *role_catalog,

appendPQExpBuffer(buf,
") AS db_owner_members "
"JOIN pg_roles pr ON pr.rolname = sys.babelfish_truncate_identifier(db_owner_members.member_role || '_obj') ");
"JOIN pg_roles pr ON pr.rolname = sys.babelfish_truncate_identifier(db_owner_members.member_role || '_bbfobj') ");

appendPQExpBuffer(buf, "), "
"bbf_roles AS (SELECT rc.* FROM %s rc INNER JOIN bbf_catalog bcat "
Expand Down Expand Up @@ -389,7 +389,7 @@ getBabelfishRoleMembershipQuery(PGconn *conn, PQExpBuffer buf,

appendPQExpBuffer(buf,
") AS db_owner_members "
"JOIN pg_roles pr ON pr.rolname = sys.babelfish_truncate_identifier(db_owner_members.member_role || '_obj') ");
"JOIN pg_roles pr ON pr.rolname = sys.babelfish_truncate_identifier(db_owner_members.member_role || '_bbfobj') ");

appendPQExpBuffer(buf, "), "
"bbf_roles AS (SELECT rc.* FROM %s rc INNER JOIN bbf_catalog bcat "
Expand Down

0 comments on commit 5752aad

Please sign in to comment.