Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vLJ3E-00Bs1z-1U for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 10:35:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vLJ3C-005Yh5-2d for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 10:35:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vLJ3C-005Ygx-1Q for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 10:35:06 +0000 Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vLJ39-0009vA-0D for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 10:35:05 +0000 Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-935241a7a0eso2675218241.2 for ; Tue, 18 Nov 2025 02:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1763462100; x=1764066900; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=O170Ys4H8JSaa088OEiCrHIdlWSAzSfiBJG9JF5ewOA=; b=dG+cWI1dEaNmAnKHi4kvEihdI7Z/XGw90VWIMkgRTzh8Tn5BQYBHx7KQivYsG2OjdP 7u0i/idx3gaCiBKR0hk4bsMm2hvvKt2LUA+9TJpY6xPftHBsHhtQcZFRSCwcm1Wn7Fwv tS4LcKW3Ew0k2lY3A/tQ6bWnCPvqzGQ1qwhEYxbRHwO9vyvljtIANzXzNpF/F7SWhGNr Wy5zUjq977TeU6qyd2RI73nSRIlZFsSge/ETxIOXdBvdGQ8yI2fYlnPU5xDHzcNRN3l9 yyON/l7zmI/t9v7cSyucE4E/DIDKgZ9KB0vZAXmp8HHFDt4QqAeB2SGwyYmDCR1pMDuU aenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763462100; x=1764066900; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O170Ys4H8JSaa088OEiCrHIdlWSAzSfiBJG9JF5ewOA=; b=gfDwmU+u8/4nmNlrJkjDVsKmKDqbVIjd8b6hIhzti3V3YCF7tXD80F7l3CBaXzin2Z kyFylex9CPfylw734QO50mggGK5GPTUmatGzn6twj9MmJb+14HTX8N9/1bOJQRf2NqCZ vE3DIpaa+6RTmeiS+3ZTCRKakLzOX80Bfc4PQJlaY1PrR6ITpc7kZIEDBhB3Jjidu/fa ZYh8nzk44uHqRSpujdg2zmaC8nij2T+UBTacHNkwKd38eokVWo24sU0F3SshqVihNf9y auiS3q0lXnFvOgTClcKlPG+XaTzLzHSPFgn2xQoGSrQgYWKFsZhpnijtbPex4PwtwYvh LsHw== X-Gm-Message-State: AOJu0YwHYJGA6mpStSix1fFz7cviKfJnjpmJ8FDAPJfIybcVnRCG45H0 5PcMzwj1HcXgng+eKhJrTUHYKwhqPtntcNya6shyvSb12WgL/mFHTUtEGK5KDV0S9LNd8gURejs z/HTTSugolzsD15ApuxNlLv8P/zP8JhDfMk79dA0R X-Gm-Gg: ASbGncuKaYM1UPlJG1HJBwSn/CsUKFiXNDOXU7FaYWjMyKhOItcTFMZp2aaMzYE3upi NqbZfrWljpr/K7X8mr7me+52tVnKEo19xWtagJS48jiQqGrfMu2uTaz8OOsgzXtS/w559bM3Vsc xWUfQiMmvOOfY5+YZnUk1QpWAhsLw5DAi+feiEao/ELcPOQ6EqklXCcDcfxqQYWWofZS2FCq2nP qv/Sq/MXgZBlNlQy4u4dkzzrkeVudVNq97QIwgXwulPA3qZWZb5Hkpcw6coizl8/xcq4f/JCA== X-Google-Smtp-Source: AGHT+IFcYxRug4aVawjv2KHaCiGUWGU4rHQyksOmKXpH4//6jRJPDr49Tn3Ml1ugAksVIbvGpzJ+iFgL6Xx/oZG+dks= X-Received: by 2002:a05:6102:3751:b0:5dd:c538:b85c with SMTP id ada2fe7eead31-5dfc5b9485dmr5499214137.24.1763462100109; Tue, 18 Nov 2025 02:35:00 -0800 (PST) MIME-Version: 1.0 References: <3f22a8bb-29e8-40cc-97a1-309181da2c13@dunslane.net> <2bed001a-462c-42da-9a6b-3c7884502932@dunslane.net> <20250824010811.4d.nmisch@google.com> <82eb35b8-7f07-493b-b689-0934919e1dc3@dunslane.net> <17555e46-4fb2-4265-90e0-95cb8ed584a6@dunslane.net> In-Reply-To: From: Vaibhav Dalvi Date: Tue, 18 Nov 2025 16:04:22 +0530 X-Gm-Features: AWmQ_bnZUbRKdSAKfT0e_UW1SzZk8rL404wQIKGJgfzq-1RBQIEFxBdWyaXQy78 Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000000d5c810643dc040d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000d5c810643dc040d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mahendra, Thanks Mahendra for working on this. Looks like my previous comment below is not addressed: 1. ### Use of Dump Options Structure (dopt) > Please ensure consistency by utilizing the main dump options > structure (`dopt`) instead of declaring and using individual variables > where the structure already provides fields. For example, the > `output_clean` variable seems redundant here: > ```c > case 'c': > output_clean =3D true; > dopt.outputClean =3D 1; > break; > ``` I agree that the output_clean variable is not added by your patch but the introduction of dopt by your patch makes it redundant because dopt has dopt.outputClean. Please look at below code from pg_dump.c for the reference: case 'c': /* clean (i.e., drop) schema prior to create */ dopt.outputClean =3D 1; break; case 25: dopt.restrict_key =3D pg_strdup(optarg); break; 2. ### 3\. Missing Example in SGML Documentation > The SGML documentation for `pg_dumpall` is missing an explicit > example demonstrating its use with non-text formats (e.g., directory > format). > It would be beneficial to include a clear example for this new feature. I think pg_dumpall should have separate examples similar to pg_dump rather than referencing the pg_dump example because pg_dumpall doesn't have to mention the database name without -l or --database in the command. 3. > > 1. Is the following change in `src/bin/pg_dump/connectdb.c` intentional= ? > > > > > ``` > > --- a/src/bin/pg_dump/connectdb.c > > +++ b/src/bin/pg_dump/connectdb.c > Yes, we need this. If there is any error, then we were trying to > disconnect the database in 2 places so we were getting a crash. I will > try to reproduce crashe without this patch and will respond. > > Have you added a test case in the regression suite which fails if we remo= ve this particular change and works well with the change? or if possible could you please demonstrate here at least. 4. The variable name *append_data* doesn't look meaningful to me. Instead we can use *append_database/**append_databases*? because if this variable is set then we dump the databases along with global objects. In case of pg_dump, append_data or data_only does make sense to differentiate between schema and data but in case of pg_dumpall if this variable is set then we're dumping schema as well as data i.e. in-short the databases. ------------------------------------ pg_dumpall.c ---------------------------------------- 5. The variable name formatName doesn't follow the naming convention of variables available around it. I think use of format_name/formatname would be better. char *use_role =3D NULL; > const char *dumpencoding =3D NULL; > + const char *formatName =3D "p"; > trivalue prompt_password =3D TRI_DEFAULT; > bool data_only =3D false; > bool globals_only =3D false; ------------------------------------ pg_restore.c ---------------------------------------- 6. Fourth parameter (i.e. append_data) to function restore_global_objects() is redundant. All the time value provided by all callers to this parameter is false. I would suggest removing this parameter and in the definition of this function call function restore_one_database() with false as 4th argument. Find diff below: --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -64,8 +64,7 @@ static int restore_one_database(const char *inputFileSpec, RestoreOptions *opts, int numWorkers, bool append_data, int num, bool globals_only); static int restore_global_objects(const char *inputFileSpec, - RestoreOptions *opts, int numWorkers, bool append_data, - int num, bool globals_only); + RestoreOptions *opts, int numWorkers, int num, bool globals_only); static int restore_all_databases(const char *inputFileSpec, SimpleStringList db_exclude_patterns, RestoreOptions *opts, int numWorkers); static int get_dbnames_list_to_restore(PGconn *conn, @@ -554,7 +553,7 @@ main(int argc, char **argv) /* Set path for toc.glo file. */ snprintf(global_path, MAXPGPATH, "%s/toc.glo", inputFileSpec); - n_errors =3D restore_global_objects(global_path, opts, numWorkers, false, 0, globals_only); + n_errors =3D restore_global_objects(global_path, opts, numWorkers, 0, globals_only); pg_log_info("database restoring skipped because option -g/--globals-only was specified"); } @@ -602,7 +601,7 @@ main(int argc, char **argv) * If globals_only is set, then skip DROP DATABASE commands from restore. */ static int restore_global_objects(const char *inputFileSpec, RestoreOptions *opts, - int numWorkers, bool append_data, int num, bool globals_only) + int numWorkers, int num, bool globals_only) { int nerror; int format =3D opts->format; @@ -610,8 +609,8 @@ static int restore_global_objects(const char *inputFileSpec, RestoreOptions *opt /* Set format as custom so that toc.glo file can be read. */ opts->format =3D archCustom; - nerror =3D restore_one_database(inputFileSpec, opts, numWorkers, - append_data, num, globals_only); + nerror =3D restore_one_database(inputFileSpec, opts, numWorkers, false, num, + globals_only); /* Reset format value. */ opts->format =3D format; @@ -1097,7 +1096,7 @@ restore_all_databases(const char *inputFileSpec, /* If map.dat has no entries, return after processing global commands. */ if (dbname_oid_list.head =3D=3D NULL) - return restore_global_objects(global_path, opts, numWorkers, false, 0, false); + return restore_global_objects(global_path, opts, numWorkers, 0, false); pg_log_info(ngettext("found %d database name in \"%s\"", "found %d database names in \"%s\"", @@ -1151,7 +1150,7 @@ restore_all_databases(const char *inputFileSpec, PQfinish(conn); /* Open toc.dat file and execute/append all the global sql commands. */ - n_errors_total =3D restore_global_objects(global_path, opts, numWorkers, false, 0, false); + n_errors_total =3D restore_global_objects(global_path, opts, numWorkers, 0, false); Regression is successful with these changes. 7. Fix indentation: > static int restore_global_objects(const char *inputFileSpec, > RestoreOptions *opts, int numWorkers, bool append_data, > int num, bool globals_only); > static int restore_all_databases(const char *inputFileSpec, > SimpleStringList db_exclude_patterns, RestoreOptions *opts, int > numWorkers); 8. Remove extra line: > + > static void usage(const char *progname); 9. Remove extra space after map.dat and before comma: > + * databases from map.dat , but skip restoring those matching 10. Fix 80 char limits: + n_errors =3D restore_one_database(subdirpath, opts, numWorkers, true, 1, false); + num_total_db =3D get_dbname_oid_list_from_mfile(inputFileSpec, &dbname_oid_list); + return restore_global_objects(global_path, opts, numWorkers, false, 0, false); + n_errors_total =3D restore_global_objects(global_path, opts, numWorkers, false, 0, false); + pg_log_warning("errors ignored on database \"%s\" restore: %d", dbidname->str, n_errors); Regards, Vaibhav On Mon, Nov 17, 2025 at 10:45=E2=80=AFPM Mahendra Singh Thalor wrote: > Thanks Andrew for the review. > On Tue, 11 Nov 2025 at 20:41, Andrew Dunstan wrote: > > > > > > On 2025-11-11 Tu 12:59 AM, Mahendra Singh Thalor wrote: > > > > > > Hi, > > > Here, I am attaching an updated patch for the review and testing. > > > > > > FIX: as suggested by Vaibhav, added error for --restrict-key option > > > with non-text format. > > > > > > > > > Regarding the name and format of the globals toc file, I'm inclined to > > think we should always use custom format, regardless of whether the > > individual databases will be in custom, tar or directory formats, and > > that it should be called something distinguishable, e.g. toc.glo. > > > > I also agree with your point. Fixed. > > On Mon, 17 Nov 2025 at 19:38, tushar > wrote: > > > > > > > > On Tue, Nov 11, 2025 at 11:29=E2=80=AFAM Mahendra Singh Thalor < > mahi6run@gmail.com> wrote: > >> > >> On Thu, 6 Nov 2025 at 11:03, Mahendra Singh Thalor > wrote: > >> > > >> > Thanks Vaibhav, Tushar and Andrew for the review and testing. > >> > > > > Thanks Mahendra, getting this error against v07 series patch > > > > [edb@1a1c15437e7c bin]$ ./pg_dumpall -Ft -f tar.dumpc -v > > pg_dumpall: executing SELECT pg_catalog.set_config('search_path', '', > false); > > pg_dumpall: pg_dumpall.c:2256: createOneArchiveEntry: Assertion `fout != =3D > ((void *)0)' failed. > > Aborted > > > > regards, > > Thanks Tushar for the report. Fixed. > > Here, I am attaching an updated patch for the review and testing. > > -- > Thanks and Regards > Mahendra Singh Thalor > EnterpriseDB: http://www.enterprisedb.com > --0000000000000d5c810643dc040d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Mahendra,

Thanks Mahendra for workin= g on this.

Looks like my previous comment below is= =C2=A0not addressed:
1.

### Use of Dump Options Structure (dopt)<= br>Please ensure consistency by utilizing the main dump options
structur= e (`dopt`) instead of declaring and using individual variables
where the= structure already provides fields. For example, the
`output_clean` vari= able seems redundant here:
```c
case 'c':
output_clean =3D= true;
dopt.outputClean =3D 1;
break;
```
<= br>
I agree that the=C2=A0output_clean variable is not added by y= our patch
but the introduction of dopt by your patch makes it red= undant because
dopt has dopt.outputClean. Please look at below co= de from pg_dump.c
for the reference:

=C2= =A0case 'c': /* clean (i.e., drop) schema prior to create */
= dopt.outputClean =3D 1;
break;
=C2=A0case 25:
= dopt.restrict_key =3D pg_strdup(optarg);
break;

=
2.

### 3\. Missing Example in SGML Documentation
The SGML doc= umentation for `pg_dumpall` is missing an explicit
example demonstrating= its use with non-text formats (e.g., directory format).
It would be ben= eficial to include a clear example for this new feature.
=

I think pg_dumpall should have separate examples simila= r to pg_dump
rather than referencing the pg_dump example because = pg_dumpall
doesn't have to mention the database name without= =C2=A0-l or --database
in the command.

3= .
> 1. Is the following change in `src/bin/pg_dump/connectdb.c` int= entional?
>
> ```
> --- = a/src/bin/pg_dump/connectdb.c
> +++ b= /src/bin/pg_dump/connectdb.c
Yes,= we need this. If there is any error, then we were trying to
disconnect = the database in 2 places so we were getting a crash. I will
try to repro= duce crashe without this patch and will respond.
<= div>Have=C2=A0you added a test=C2=A0case in the regression suite which fail= s=C2=A0if we remove
this particular change and works well with th= e change? or if possible could
you please demonstrate here at lea= st.

4. The variable name=C2=A0append_data d= oesn't look meaningful to me.
Instead we can use append_da= tabase/append_databases?
because if this variable is s= et then we dump the databases along with
global objects. In case = of pg_dump, append_data or data_only does make
sense to different= iate between schema and data but in case of pg_dumpall
if this va= riable is set then we're dumping schema as well as data i.e. in-short
the databases.

--------------------------= ---------- pg_dumpall.c ----------------------------------------
=
5. The variable name formatName doesn't follow the namin= g convention of=C2=A0
variables available around it. I think use = of format_name/formatname would
be better.

=C2=A0char =C2=A0 *use_rol= e =3D NULL;
=C2=A0 const char *dumpencoding =3D NULL;
+ const char *f= ormatName =3D "p";
=C2=A0 trivalue prompt_password =3D TRI_DEF= AULT;
=C2=A0 bool data_only =3D false;
=C2=A0 bool globals_only =3D= false;

-----------------------------------= - pg_restore.c ----------------------------------------

6. Fourth parameter (i.e. append_data) to function=C2=A0restore_globa= l_objects() is redundant.
All the time value provided by all call= ers to this parameter is false.

I would suggest re= moving this parameter and in the definition of this function
call= function restore_one_database() with false as 4th argument. Find diff belo= w:

--- a/src/bin/pg_dump/pg_restore.c
+++ b/src= /bin/pg_dump/pg_restore.c
@@ -64,8 +64,7 @@ static int =C2=A0 =C2=A0rest= ore_one_database(const char *inputFileSpec, RestoreOptions *opts,
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0int numWorkers, bool append_data, int num,
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool globals_onl= y);
=C2=A0static int restore_global_objects(const char *inputFileSpec,- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RestoreOptions *opts, = int numWorkers, bool append_data,
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 int num, bool globals_only);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 RestoreOptions *opts, int numWorkers, int num, bool g= lobals_only);
=C2=A0static int =C2=A0 =C2=A0 restore_all_databases(const= char *inputFileSpec,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 SimpleStringList db_exclude_patterns, RestoreOptions *opts, int numW= orkers);
=C2=A0static int =C2=A0 =C2=A0 get_dbnames_list_to_restore(PGco= nn *conn,
@@ -554,7 +553,7 @@ main(int argc, char **argv)
=C2=A0
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 /* Set path for toc.glo file. */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 snprintf(global_pat= h, MAXPGPATH, "%s/toc.glo", inputFileSpec);
- =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 n_errors =3D= restore_global_objects(global_path, opts, numWorkers, false, 0, globals_on= ly);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 n_errors =3D restore_global_objects(global_path, opts, numWor= kers, 0, globals_only);
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pg_log_info("database re= storing skipped because option -g/--globals-only was specified");
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
@@ -602,7 +601= ,7 @@ main(int argc, char **argv)
=C2=A0 * If globals_only is set, then = skip DROP DATABASE commands from restore.
=C2=A0 */
=C2=A0static int = restore_global_objects(const char *inputFileSpec, RestoreOptions *opts,
= - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int numWorkers, bool app= end_data, int num, bool globals_only)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 int numWorkers, int num, bool globals_only)
=C2=A0{=C2=A0 =C2=A0 =C2=A0 =C2=A0 int =C2=A0 =C2=A0 nerror;
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 int =C2=A0 =C2=A0 format =3D opts->format;
@@ -610,8 +609,= 8 @@ static int restore_global_objects(const char *inputFileSpec, RestoreOp= tions *opt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Set format as custom so that t= oc.glo file can be read. */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 opts->format = =3D archCustom;
=C2=A0
- =C2=A0 =C2=A0 =C2=A0 nerror =3D restore_one_= database(inputFileSpec, opts, numWorkers,
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 append_data, num, globals_= only);
+ =C2=A0 =C2=A0 =C2=A0 nerror =3D restore_one_database(inputFileS= pec, opts, numWorkers, false, num,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 globals_only);
=C2=A0
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 /* Reset format value. */
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 opts->format =3D format;
@@ -1097,7 +1096,7 @@ restore_all_dat= abases(const char *inputFileSpec,
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = /* If map.dat has no entries, return after processing global commands. */=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dbname_oid_list.head =3D=3D NULL)
- = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return restore_global_obje= cts(global_path, opts, numWorkers, false, 0, false);
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return restore_global_objects(global_path, = opts, numWorkers, 0, false);
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pg_lo= g_info(ngettext("found %d database name in \"%s\"",
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0"found %d database names in \"%s\"= ;",
@@ -1151,7 +1150,7 @@ restore_all_databases(const char *inputFi= leSpec,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PQfinish= (conn);
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Open toc.dat file and e= xecute/append all the global sql commands. */
- =C2=A0 =C2=A0 =C2=A0 n_e= rrors_total =3D =C2=A0restore_global_objects(global_path, opts, numWorkers,= false, 0, false);
+ =C2=A0 =C2=A0 =C2=A0 n_errors_total =3D =C2=A0resto= re_global_objects(global_path, opts, numWorkers, 0, false);
<= br>
Regression is successful with these changes.

7. Fix indentation:
static int restore_global_objects(const char *inputFileSpec,
= RestoreOptions *opts, int numWorkers, bool append_data,
int num, boo= l globals_only);
static int restore_all_databases(const char *inputFileS= pec,
SimpleStringList db_exclude_patterns, RestoreOptions *opts, int n= umWorkers);

8. Remove extra line:
+
=C2=A0static void usage(= const char *progname);

9. Remove extra spac= e after map.dat and before comma:
+ * databases from map.dat , but skip restoring those matchi= ng
=C2=A0
10. Fix 80 char limits:

=
+ n_errors =3D restore_one_database(subdirpath, opts, numWorker= s, true, 1, false);

+ num_total_db =3D get_dbn= ame_oid_list_from_mfile(inputFileSpec, &dbname_oid_list);

+ return restore_global_objects(global_path, opts, numWork= ers, false, 0, false);

+ n_errors_total =3D = =C2=A0restore_global_objects(global_path, opts, numWorkers, false, 0, false= );

+ pg_log_warning("errors ignored on = database \"%s\" restore: %d", dbidname->str, n_errors);



Regards,
Vaibhav

On Mon, Nov 17, 2025 at 10:45=E2= =80=AFPM Mahendra Singh Thalor <ma= hi6run@gmail.com> wrote:
Thanks Andrew for the review.
On Tue, 11 Nov 2025 at 20:41, Andrew Dunstan <andrew@dunslane.net> wrote:
>
>
> On 2025-11-11 Tu 12:59 AM, Mahendra Singh Thalor wrote:
> >
> > Hi,
> > Here, I am attaching an updated patch for the review and testing.=
> >
> > FIX: as suggested by Vaibhav, added error for --restrict-key opti= on
> > with non-text format.
> >
>
>
> Regarding the name and format of the globals toc file, I'm incline= d to
> think we should always use custom format, regardless of whether the > individual databases will be in custom, tar or directory formats, and<= br> > that it should be called something distinguishable, e.g. toc.glo.
>

I also agree with your point. Fixed.

On Mon, 17 Nov 2025 at 19:38, tushar <tushar.ahuja@enterprisedb.com> wrot= e:
>
>
>
> On Tue, Nov 11, 2025 at 11:29=E2=80=AFAM Mahendra Singh Thalor <mahi6run@gmail.com= > wrote:
>>
>> On Thu, 6 Nov 2025 at 11:03, Mahendra Singh Thalor <mahi6run@gmail.com> wro= te:
>> >
>> > Thanks Vaibhav, Tushar and Andrew for the review and testing.=
>>
>
> Thanks Mahendra, getting this error against v07 series patch
>
>=C2=A0 [edb@1a1c15437e7c bin]$ ./pg_dumpall -Ft -f tar.dumpc=C2=A0 -v > pg_dumpall: executing SELECT pg_catalog.set_config('search_path= 9;, '', false);
> pg_dumpall: pg_dumpall.c:2256: createOneArchiveEntry: Assertion `fout = !=3D ((void *)0)' failed.
> Aborted
>
> regards,

Thanks Tushar for the report. Fixed.

Here, I am attaching an updated patch for the review and testing.

--
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com
--0000000000000d5c810643dc040d--