Skip to content
Snippets Groups Projects
Commit dea95c7a authored by Robert Haas's avatar Robert Haas
Browse files

Dump all roles first, then all config settings on roles.

This way, if a role's config setting uses the name of another role,
the validity of the dump isn't dependent on the order in which those
two roles are dumped.

Code by Phil Sorber, comment by me.
parent 393e828e
Branches
Tags
No related merge requests found
...@@ -804,10 +804,16 @@ dumpRoles(PGconn *conn) ...@@ -804,10 +804,16 @@ dumpRoles(PGconn *conn)
buf, "ROLE", rolename); buf, "ROLE", rolename);
fprintf(OPF, "%s", buf->data); fprintf(OPF, "%s", buf->data);
}
/*
* Dump configuration settings for roles after all roles have been dumped.
* We do it this way because config settings for roles could mention the
* names of other roles.
*/
if (server_version >= 70300) if (server_version >= 70300)
dumpUserConfig(conn, rolename); for (i = 0; i < PQntuples(res); i++)
} dumpUserConfig(conn, PQgetvalue(res, i, i_rolname));
PQclear(res); PQclear(res);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment