Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdea95c7

Browse files
committed
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 thosetwo roles are dumped.Code by Phil Sorber, comment by me.
1 parent393e828 commitdea95c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/bin/pg_dump/pg_dumpall.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,17 @@ dumpRoles(PGconn *conn)
804804
buf,"ROLE",rolename);
805805

806806
fprintf(OPF,"%s",buf->data);
807-
808-
if (server_version >=70300)
809-
dumpUserConfig(conn,rolename);
810807
}
811808

809+
/*
810+
* Dump configuration settings for roles after all roles have been dumped.
811+
* We do it this way because config settings for roles could mention the
812+
* names of other roles.
813+
*/
814+
if (server_version >=70300)
815+
for (i=0;i<PQntuples(res);i++)
816+
dumpUserConfig(conn,PQgetvalue(res,i,i_rolname));
817+
812818
PQclear(res);
813819

814820
fprintf(OPF,"\n\n");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp