public inbox for [email protected]
help / color / mirror / Atom feedFrom: Guillaume Lelarge <[email protected]>
To: Mahendra Singh Thalor <[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: Wed, 8 Jan 2025 22:00:02 +0100
Message-ID: <CAECtzeXHvNNmVPwysJsCFoqfej4fx-bbzf+myjsM5Umj7kG_Pg@mail.gmail.com> (raw)
In-Reply-To: <CAKYtNAr+xdxtTdTTnjA8B+qkZMrjw6m9geMHcFFQH1itederoQ@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>
Hi,
Le mer. 8 janv. 2025 à 17:41, Mahendra Singh Thalor <[email protected]> a
écrit :
> On Wed, 8 Jan 2025 at 20:07, Mahendra Singh Thalor <[email protected]>
> wrote:
> >
> > Hi all,
> >
> > On Wed, 8 Jan 2025 at 00:34, Mahendra Singh Thalor <[email protected]>
> wrote:
> > >
> > > On Mon, 6 Jan 2025 at 23:05, Nathan Bossart <[email protected]>
> wrote:
> > > >
> > > > On Thu, Jan 02, 2025 at 02:05:13AM +0530, Mahendra Singh Thalor
> wrote:
> > > > > Here, I am attaching an updated patch. I fixed some bugs of v01
> patch and
> > > > > did some code cleanup also.
> > > >
> > > > Thank you for picking this up! I started to review it, but the
> > > > documentation changes didn't build, and a few tests in check-world
> are
> > > > failing. Would you mind resolving those issues? Also, if you
> haven't
> > > > already, please add an entry to the next commitfest [0] to ensure
> that 1)
> > > > this feature is tracked and 2) the automated tests will run.
> > >
> > > Thanks Nathan for the quick response.
> > >
> > > I fixed bugs of documentation changes and check-world in the latest
> patch. Now docs are building and check-world is passing.
> > >
> > > I added entry into commitfest for this patch.[0]
> > >
> > > >
> > > > + if (dbfile)
> > > > + {
> > > > + printfPQExpBuffer(&cmd, "\"%s\" %s %s", pg_dump_bin,
> > > > + dbfile,
> create_opts);
> > > > + appendPQExpBufferStr(&cmd, " -F d ");
> > > > + }
> > > >
> > > > Have you given any thought to allowing a directory of custom format
> files,
> > > > as discussed upthread [1]? Perhaps that is better handled as a
> follow-up
> > > > patch, but it'd be good to understand the plan, anyway.
> > >
> > > I will make these changes and will test. I will update my findings
> after doing some testing.
> >
> > In the latest patch, I added dump and restoring for
> directory/custom/tar/plain formats. Please consider this patch for review
> and testing.
> >
> > Design:
> > When we give --format=d|c|t then we are dumping all global sql commands
> in global.dat in plain sql format and we are making a map.dat file with
> dbname and dboid. For each database, we are making separate subdirectory
> with dboid under databases directory and dumping as per archive
> format(d|c|t).
> > While restoring, first we are restoring all global sql commands from
> global.dat and then we are restoring one by one all databases. As we are
> supporting --exclude-database with pg_dumpall, the same we are supporting
> with pg_restore also to skip restoring on some specified database patterns.
> > If we want to restore a single database, then we can specided particular
> subdirectory from the databases folder. To get file name, we refer dbname
> into map.file.
> >
> > TODO: Now I will work on test cases for these new added options to the
> pg_dumpall and pg_restore.
> >
> > Here, I am attaching the v04 patch for testing and review.
>
> Sorry. My mistake.
> v04 was the delta patch on the top of v03.
>
> Here, I am attaching the v05 patch for testing and review.
>
>
Just FWIW, I did a quick test tonight. It applies cleanly, compiles OK. I
did a dump:
$ pg_dumpall -Fd -f dir
and then a restore (after dropping the databases I had):
$ pg_restore -Cd postgres -v dir
It worked really well. That's great.
Quick thing to fix: you've got this error message:
pg_restore: error: -d/--dbanme should be given when using archive dump of
pg_dumpall
I guess it is --dbname, rather than --dbanme.
Of course, it needs much more testing, but this feature would be great to
have. Thanks for working on this!
--
Guillaume.
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]
Subject: Re: Non-text mode for pg_dumpall
In-Reply-To: <CAECtzeXHvNNmVPwysJsCFoqfej4fx-bbzf+myjsM5Umj7kG_Pg@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