public inbox for [email protected]
help / color / mirror / Atom feedFrom: jian he <[email protected]>
To: Mahendra Singh Thalor <[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: Sat, 11 Jan 2025 13:48:27 +0800
Message-ID: <CACJufxGUucc2wscPFoZHHA9Ea4--wz-Lm86zm14s5TfTPZSqbw@mail.gmail.com> (raw)
In-Reply-To: <CAKYtNAp9vOtydXL3_pnGJ+TetZtN=FYSnZSMCqXceU3mkHPxPg@mail.gmail.com>
References: <[email protected]>
<ZmcKMF61K4Ck51dK@nathan>
<CABUevExoQ26jo+aQ9QZq+UMA1aD6gfpm9xBnh_t5e0DhaCeRYA@mail.gmail.com>
<ZmcVqPOGjoccIh-i@nathan>
<CABUevEyMEaaY37_eMW76F97TX2voxdtPNkm3FGqN9c3ZHy3GMg@mail.gmail.com>
<[email protected]>
<CABUevEwv4kQ5of9e+3mZ=Q9ZfkNtDbidPCLuDU_sm00d2Yf-rQ@mail.gmail.com>
<CAKYtNAryL7Y-JEasiDCts+iiMRufNi74HpPvf=T4b9a1NSa_PQ@mail.gmail.com>
<CAKYtNArH1=1gf=1t-OErx5G0y2P1nog1atQ4HMyxY2S5ocdnSA@mail.gmail.com>
<Z3wUepoqtow7EeeR@nathan>
<CAKYtNArQDOnTLCo6u8dU+32v-P5qe_naG+-hGrL=S2ZgMyS-_Q@mail.gmail.com>
<CAKYtNAokugMDYMvqZLuhS7ghD55J9yeYoQzrSNRY9=bPz3Lbtw@mail.gmail.com>
<CAKYtNAr+xdxtTdTTnjA8B+qkZMrjw6m9geMHcFFQH1itederoQ@mail.gmail.com>
<CAECtzeXHvNNmVPwysJsCFoqfej4fx-bbzf+myjsM5Umj7kG_Pg@mail.gmail.com>
<CAKYtNArMEsup-8QF9cBREwXjAOaqptGWF1eX1H=dRuTx3BWtwg@mail.gmail.com>
<CAKYtNAp9vOtydXL3_pnGJ+TetZtN=FYSnZSMCqXceU3mkHPxPg@mail.gmail.com>
in src/bin/pg_dump/pg_dumpall.c main
i think you need do
archDumpFormat = parseDumpFormat(formatName);
/*
* Open the output file if required, otherwise use stdout. If required,
* then create new files with global.dat and map.dat names.
*/
if (archDumpFormat != archNull)
{
char toc_path[MAXPGPATH];
/*
* If directory/tar/custom format is specified then we must provide the
* file name to create one main directory.
*/
if (!filename || strcmp(filename, "") == 0)
pg_fatal("no output directory specified");
/* TODO: accept the empty existing directory. */
if (mkdir(filename, 0700) < 0)
pg_fatal("could not create directory \"%s\": %m",
filename);
snprintf(toc_path, MAXPGPATH, "%s/global.dat", filename);
OPF = fopen(toc_path, "w");
if (!OPF)
pg_fatal("could not open global.dat file: %s", strerror(errno));
}
else if (filename)
{
OPF = fopen(filename, PG_BINARY_W);
if (!OPF)
pg_fatal("could not open output file \"%s\": %m",
filename);
}
else
OPF = stdout;
before connectDatabase call.
otherwise if the cluster is not setting up.
``pg_dumpall --format=d``
error would be about connection error, not
"pg_dumpall: error: no output directory specified"
we want ``pg_dumpall --format`` invalid options
to error out even if the cluster is not setting up.
attached are two invalid option test cases.
you also need change
<varlistentry>
<term><option>-f <replaceable
class="parameter">filename</replaceable></option></term>
<term><option>--file=<replaceable
class="parameter">filename</replaceable></option></term>
<listitem>
<para>
Send output to the specified file. If this is omitted, the
standard output is used.
</para>
</listitem>
</varlistentry>
?
since if --format=d,
<option>--file=<replaceable class="parameter">filename</replaceable></option>
can not be omitted.
Attachments:
[application/octet-stream] v7-0001-misc-tests-for-pg_dumpall.no-cfbot (1.5K, 2-v7-0001-misc-tests-for-pg_dumpall.no-cfbot)
download
view thread (7+ 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]
Subject: Re: Non-text mode for pg_dumpall
In-Reply-To: <CACJufxGUucc2wscPFoZHHA9Ea4--wz-Lm86zm14s5TfTPZSqbw@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