@@ -1346,6 +1346,7 @@ dumpUserConfig(PGconn *conn, const char *username)
13461346{
13471347 PQExpBuffer buf = createPQExpBuffer ();
13481348 int count = 1 ;
1349+ bool first = true;
13491350
13501351 for (;;)
13511352 {
@@ -1367,6 +1368,14 @@ dumpUserConfig(PGconn *conn, const char *username)
13671368 if (PQntuples (res ) == 1 &&
13681369 !PQgetisnull (res , 0 , 0 ))
13691370 {
1371+ /* comment at section start, only if needed */
1372+ if (first )
1373+ {
1374+ fprintf (OPF , "--\n-- User Configurations\n--\n\n" );
1375+ first = false;
1376+ }
1377+
1378+ fprintf (OPF , "--\n-- User Config \"%s\"\n--\n\n" , username );
13701379 resetPQExpBuffer (buf );
13711380 makeAlterConfigCommand (conn , PQgetvalue (res , 0 , 0 ),
13721381 "ROLE" , username , NULL , NULL ,
@@ -1454,6 +1463,9 @@ dumpDatabases(PGconn *conn)
14541463 "WHERE datallowconn "
14551464 "ORDER BY (datname <> 'template1'), datname" );
14561465
1466+ if (PQntuples (res ) > 0 )
1467+ fprintf (OPF , "--\n-- Databases\n--\n\n" );
1468+
14571469 for (i = 0 ; i < PQntuples (res ); i ++ )
14581470 {
14591471 char * dbname = PQgetvalue (res , i , 0 );
@@ -1476,6 +1488,8 @@ dumpDatabases(PGconn *conn)
14761488 if (verbose )
14771489 fprintf (stderr , _ ("%s: dumping database \"%s\"...\n" ), progname , dbname );
14781490
1491+ fprintf (OPF , "--\n-- Database \"%s\" dump\n--\n\n" , dbname );
1492+
14791493 /*
14801494 * We assume that "template1" and "postgres" already exist in the
14811495 * target installation. dropDBs() won't have removed them, for fear
0 commit comments