diff --git a/src/bin/pg_dump/dump_babel_utils.c b/src/bin/pg_dump/dump_babel_utils.c index 6d8ba85c208..fc03489962e 100644 --- a/src/bin/pg_dump/dump_babel_utils.c +++ b/src/bin/pg_dump/dump_babel_utils.c @@ -1175,10 +1175,14 @@ addFromClauseForPhysicalDatabaseDump(PQExpBuffer buf, TableInfo *tbinfo) "WHERE a.rolname NOT IN %s", fmtQualifiedDumpable(tbinfo), default_bbf_db_principals); } + /* + * Do not dump sysadmin, bbf_role_admin, securityadmin, + * dbcreator and Babelfish initialize user + */ else if(strcmp(tbinfo->dobj.name, "babelfish_authid_login_ext") == 0) appendPQExpBuffer(buf, " FROM ONLY %s a " "WHERE a.rolname NOT IN ('sysadmin', 'bbf_role_admin', " - "'securityadmin', '%s')", /* Do not dump sysadmin, bbf_role_admin, securityadmin and Babelfish initialize user */ + "'securityadmin', 'dbcreator', '%s')", fmtQualifiedDumpable(tbinfo), babel_init_user); else if(strcmp(tbinfo->dobj.name, "babelfish_domain_mapping") == 0 || strcmp(tbinfo->dobj.name, "babelfish_function_ext") == 0 || diff --git a/src/bin/pg_dump/dumpall_babel_utils.c b/src/bin/pg_dump/dumpall_babel_utils.c index d30c713f7bc..c0b73383507 100644 --- a/src/bin/pg_dump/dumpall_babel_utils.c +++ b/src/bin/pg_dump/dumpall_babel_utils.c @@ -35,7 +35,7 @@ typedef enum { static babelfish_status bbf_status = NONE; -static char default_bbf_roles[] = "('sysadmin', 'bbf_role_admin', 'securityadmin', " +static char default_bbf_roles[] = "('sysadmin', 'bbf_role_admin', 'securityadmin', 'dbcreator', " "'master_dbo', 'master_db_owner', 'master_guest', 'master_db_accessadmin', 'master_db_datareader', 'master_db_datawriter', " "'msdb_dbo', 'msdb_db_owner', 'msdb_guest', 'msdb_db_accessadmin', 'msdb_db_datareader', 'msdb_db_datawriter', " "'tempdb_dbo', 'tempdb_db_owner', 'tempdb_guest', 'tempdb_db_accessadmin', 'tempdb_db_datareader', 'tempdb_db_datawriter')"; @@ -301,7 +301,8 @@ getBabelfishRoleMembershipQuery(PGconn *conn, PQExpBuffer buf, appendPQExpBufferStr(buf, "SELECT 'sysadmin' AS rolname UNION " "SELECT 'bbf_role_admin' AS rolname UNION " - "SELECT 'securityadmin' AS rolname UNION "); + "SELECT 'securityadmin' AS rolname UNION " + "SELECT 'dbcreator' AS rolname UNION "); appendPQExpBuffer(buf, "SELECT rolname FROM sys.babelfish_authid_user_ext "); /* Only dump users of the specific logical database we are currently dumping. */