public inbox for [email protected]  
help / color / mirror / Atom feed
From: jian he <[email protected]>
To: Mahendra Singh Thalor <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Guillaume Lelarge <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Magnus Hagander <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: Dilip Kumar <[email protected]>
Subject: Re: Non-text mode for pg_dumpall
Date: Tue, 21 Jan 2025 00:01:42 +0800
Message-ID: <CACJufxHNNjAhVYJQS8x5U-9Fqsj6+tzG4uCivk2XTAOPTmstTA@mail.gmail.com> (raw)
In-Reply-To: <CAKYtNApE=x0sZxU3c9KqsYRU3dCztcfhQ+CDWhzgtH83HQUkuA@mail.gmail.com>
References: <CAKYtNAp9vOtydXL3_pnGJ+TetZtN=FYSnZSMCqXceU3mkHPxPg@mail.gmail.com>
	<[email protected]>
	<CAKYtNAo-6HZy-JhTYS321AxGE_BPCg7WTFVLeXTuFMZ6HYK2vg@mail.gmail.com>
	<CACJufxGcZ1rK94cgfdc9McCD7W-83PT9_cx5VoFeC-HVc10Wzg@mail.gmail.com>
	<CAKYtNAqd4k+4+XANxjDc35i+WPme476DkP7msjYpX85F+4UsUg@mail.gmail.com>
	<CAKYtNAobHS158cfmA3X+Zr+oJ1ffNjjn3+BrU4-MokZ16jSVzw@mail.gmail.com>
	<CACJufxEtDgADBXQhX5cp3mJtNVMy+j+Jdovuk3PWe5qJ0sE3Ag@mail.gmail.com>
	<CAKYtNArwUxqR=LkQY1PT7tw+raMhf53oafo4WmSHGPHiER9d=A@mail.gmail.com>
	<CACJufxHUDGWe=2ZukvMfuwEcSK8CsVYm=9+rtPnrW7CRCfoCsw@mail.gmail.com>
	<CACJufxGOy1kAot+SAD9siKB797rj9K-bqeZOrS4fDYFFLo31bA@mail.gmail.com>
	<CAKYtNApE=x0sZxU3c9KqsYRU3dCztcfhQ+CDWhzgtH83HQUkuA@mail.gmail.com>

hi.
some minor issues come to my mind when I look at it again.

looking at set_null_conf,
i think "if (archDumpFormat != archNull)" can be:

if (archDumpFormat != archNull)
{
OPF = fopen(toc_path, "w");
if (!OPF)
    pg_fatal("could not open global.dat file: \"%s\" for writing: %m",
toc_path);
}

some places we use ``fopen(filename, PG_BINARY_W)``,
some places we use ``fopen(filename, "w");``
kind of inconsistent...


+    printf(_("  -F, --format=c|d|t|p         output file format
(custom, directory, tar,\n"
+                "                            plain text (default))\n"));
this indentation level is not right?
if we look closely at the surrounding output of `pg_dumpall --help`.


pg_dump.sgml --create option description:
This option is ignored when emitting an archive (non-text) output file. For the
archive formats, you can specify the option when you call pg_restore.

in runPgDump, we have:
/*
* If this is non-plain format dump, then append file name and dump
* format to the pg_dump command to get archive dump.
*/
if (archDumpFormat != archNull)
{
    printfPQExpBuffer(&cmd, "\"%s\" -f %s %s", pg_dump_bin,
                        dbfile, create_opts);
    ...
}

so in here, create_opts is not necessary per pg_dump.sgml above description.
we can simplify it as:

if (archDumpFormat != archNull)
{
    printfPQExpBuffer(&cmd, "\"%s\" --file=%s", pg_dump_bin, dbfile);
}
?






view thread (36+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Non-text mode for pg_dumpall
  In-Reply-To: <CACJufxHNNjAhVYJQS8x5U-9Fqsj6+tzG4uCivk2XTAOPTmstTA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox