From: Daniel Gustafsson Date: Wed, 26 Apr 2023 12:24:13 +0000 (+0200) Subject: Fix stop condition for dumping GRANT commands X-Git-Tag: REL_16_BETA1~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b7fa85130330128b404eddebd4f33c6739454b0;p=thirdparty%2Fpostgresql.git Fix stop condition for dumping GRANT commands Commit ce6b672e44 changed dumping GRANT commands to ensure that grantors already have an ADMIN OPTION on the role for which it is granting permissions. Looping over the grants per role has a stop condition on dumping the grant statements, but accidentally missed updating the variable for the conditional check. Author: Andreas Scherbaum Co-authored-by: Artur Zakirov Discussion: https://postgr.es/m/de44299d-cd31-b41f-2c2a-161fa5e586a5@pgug.de --- diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 71a1319865d..988a0cd4735 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -1052,6 +1052,7 @@ dumpRoleMembership(PGconn *conn) PQfinish(conn); exit_nicely(1); } + prev_remaining = remaining; /* Make one pass over the grants for this role. */ for (i = start; i < end; ++i)