Re: -f <output file> option for pg_dumpall

Lists: pgsql-hackers
From: Dave Page <dpage(at)postgresql(dot)org>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: -f <output file> option for pg_dumpall
Date: 2007-01-05 17:26:31
Message-ID: 459E8A47.9020001@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

In pgAdmin we use pg_dump's -f option to write backup files. The IO
streams are redirected to display status and errors etc. in the GUI.

In order to enhance the interface to allow backup of entire clusters as
well as role and tablespace definitions, we need to be able to get
pg_dumpall to write it's output directly to a file in the same way,
because we cannot redirect the child pg_dump IO streams (which also
means we may miss errors, but I need to think about that some more).

As far as I can see, adding a -f option to pg_dumpall should be straight
forward, the only issue being that we'd need to pass pg_dump an
additional (undocumented?) option to tell it to append to the output
file instead of writing it as normal.

Any thoughts or better ideas?

Regards, Dave.


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 17:35:03
Message-ID: 1168018503.18376.29.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> As far as I can see, adding a -f option to pg_dumpall should be straight
> forward, the only issue being that we'd need to pass pg_dump an
> additional (undocumented?) option to tell it to append to the output
> file instead of writing it as normal.
>
> Any thoughts or better ideas?

Yeah :) Getting rid of pg_dumpall entirely and merging it into pg_dump.
It is kind of silly that we have two different versions. Although that
may be more work than you were considering.

Joshua D. Drake

>
> Regards, Dave.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 17:40:20
Message-ID: 459E8D84.10708@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> In pgAdmin we use pg_dump's -f option to write backup files. The IO
> streams are redirected to display status and errors etc. in the GUI.
>
> In order to enhance the interface to allow backup of entire clusters as
> well as role and tablespace definitions, we need to be able to get
> pg_dumpall to write it's output directly to a file in the same way,
> because we cannot redirect the child pg_dump IO streams (which also
> means we may miss errors, but I need to think about that some more).
>
> As far as I can see, adding a -f option to pg_dumpall should be straight
> forward, the only issue being that we'd need to pass pg_dump an
> additional (undocumented?) option to tell it to append to the output
> file instead of writing it as normal.
>
> Any thoughts or better ideas?
>
>

This seems a bit like piecemeal reform. Here are some things I'd like to
see that affect this area:

. merge pg_dump and pg_dumpall (e.g. add a flag to pg_dump that says do
the lot)
. multi-db non-text dumps

And while we're about it, can we teach pg_restore to handle text dumps?
Even if it just transparently called psql it would be nice.

cheers

andrew


From: Darcy Buskermolen <darcy(at)ok-connect(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 17:47:19
Message-ID: 200701050947.20117.darcy@ok-connect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 05 January 2007 09:40, Andrew Dunstan wrote:
> Dave Page wrote:
> > In pgAdmin we use pg_dump's -f option to write backup files. The IO
> > streams are redirected to display status and errors etc. in the GUI.
> >
> > In order to enhance the interface to allow backup of entire clusters as
> > well as role and tablespace definitions, we need to be able to get
> > pg_dumpall to write it's output directly to a file in the same way,
> > because we cannot redirect the child pg_dump IO streams (which also
> > means we may miss errors, but I need to think about that some more).
> >
> > As far as I can see, adding a -f option to pg_dumpall should be straight
> > forward, the only issue being that we'd need to pass pg_dump an
> > additional (undocumented?) option to tell it to append to the output
> > file instead of writing it as normal.
> >
> > Any thoughts or better ideas?
>
> This seems a bit like piecemeal reform. Here are some things I'd like to
> see that affect this area:
>
> . merge pg_dump and pg_dumpall (e.g. add a flag to pg_dump that says do
> the lot)
> . multi-db non-text dumps
>
> And while we're about it, can we teach pg_restore to handle text dumps?
> Even if it just transparently called psql it would be nice.

+1 on on having pg_restore work with text dumps.

>
> cheers
>
> andrew
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org


From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 17:50:49
Message-ID: 459E8FF9.3090900@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> In pgAdmin we use pg_dump's -f option to write backup files. The IO
> streams are redirected to display status and errors etc. in the GUI.
>
> In order to enhance the interface to allow backup of entire clusters as
> well as role and tablespace definitions, we need to be able to get
> pg_dumpall to write it's output directly to a file in the same way,
> because we cannot redirect the child pg_dump IO streams (which also
> means we may miss errors, but I need to think about that some more).
>
> As far as I can see, adding a -f option to pg_dumpall should be straight
> forward, the only issue being that we'd need to pass pg_dump an
> additional (undocumented?) option to tell it to append to the output
> file instead of writing it as normal.
>
> Any thoughts or better ideas?
>
Use pgAdmin's "create script" funcion on the server.

Regards,
Andreas


From: David Fetter <david(at)fetter(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Dave Page <dpage(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 19:02:13
Message-ID: 20070105190213.GB31230@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jan 05, 2007 at 12:40:20PM -0500, Andrew Dunstan wrote:
> Dave Page wrote:
> >In pgAdmin we use pg_dump's -f option to write backup files. The IO
> >streams are redirected to display status and errors etc. in the GUI.
> >
> >In order to enhance the interface to allow backup of entire clusters as
> >well as role and tablespace definitions, we need to be able to get
> >pg_dumpall to write it's output directly to a file in the same way,
> >because we cannot redirect the child pg_dump IO streams (which also
> >means we may miss errors, but I need to think about that some more).
> >
> >As far as I can see, adding a -f option to pg_dumpall should be straight
> >forward, the only issue being that we'd need to pass pg_dump an
> >additional (undocumented?) option to tell it to append to the output
> >file instead of writing it as normal.
> >
> >Any thoughts or better ideas?
>
>
> This seems a bit like piecemeal reform. Here are some things I'd like to
> see that affect this area:
>
> . merge pg_dump and pg_dumpall (e.g. add a flag to pg_dump that says do
> the lot)
> . multi-db non-text dumps
>
> And while we're about it, can we teach pg_restore to handle text dumps?
> Even if it just transparently called psql it would be nice.

+1 on all of this :)

Cheers,
D (who can contribute code once we've agreed on what it should do)
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!


From: Dave Page <dpage(at)postgresql(dot)org>
To: David Fetter <david(at)fetter(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 20:03:33
Message-ID: 459EAF15.7010000@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
>> This seems a bit like piecemeal reform. Here are some things I'd like to
>> see that affect this area:
>>
>> . merge pg_dump and pg_dumpall (e.g. add a flag to pg_dump that says do
>> the lot)
>> . multi-db non-text dumps
>>
>> And while we're about it, can we teach pg_restore to handle text dumps?
>> Even if it just transparently called psql it would be nice.
>
> +1 on all of this :)

Hmm, well I have no interest in the latter at present, but assuming the
powers that be will allow me some time to do so, I will look at merging
pg_dump and pg_dumpall as that seems to be the way people want to go.
I'd also like to tweak the options for global objects to allow roles and
tablespaces to be dumped seperately from each other if no-one objects.

> Cheers,
> D (who can contribute code once we've agreed on what it should do)

Cool - fancy picking up the multi-db non text and pg_restore bits if I
do the former?

Regards, Dave.


From: Dave Page <dpage(at)postgresql(dot)org>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 20:05:26
Message-ID: 459EAF86.9030606@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andreas Pflug wrote:
> Dave Page wrote:
>> In pgAdmin we use pg_dump's -f option to write backup files. The IO
>> streams are redirected to display status and errors etc. in the GUI.
>>
>> In order to enhance the interface to allow backup of entire clusters as
>> well as role and tablespace definitions, we need to be able to get
>> pg_dumpall to write it's output directly to a file in the same way,
>> because we cannot redirect the child pg_dump IO streams (which also
>> means we may miss errors, but I need to think about that some more).
>>
>> As far as I can see, adding a -f option to pg_dumpall should be straight
>> forward, the only issue being that we'd need to pass pg_dump an
>> additional (undocumented?) option to tell it to append to the output
>> file instead of writing it as normal.
>>
>> Any thoughts or better ideas?
>>
> Use pgAdmin's "create script" funcion on the server.

We said long ago we weren't going to replicate pg_dump functionality in
pgAdmin - a brief discussion on the pgadmin-hackers list earlier
indicates that people still feel the same way, and that time would be
better spend fixing pg_dump/pg_dumpall.

Regards, Dave.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 22:48:17
Message-ID: 10121.1168037297@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page <dpage(at)postgresql(dot)org> writes:
> As far as I can see, adding a -f option to pg_dumpall should be straight
> forward, the only issue being that we'd need to pass pg_dump an
> additional (undocumented?) option to tell it to append to the output
> file instead of writing it as normal.

Wouldn't it be easier/better to re-point stdout at the -f file, and not
touch pg_dump at all?

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 22:52:37
Message-ID: 10168.1168037557@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page <dpage(at)postgresql(dot)org> writes:
> Hmm, well I have no interest in the latter at present, but assuming the
> powers that be will allow me some time to do so, I will look at merging
> pg_dump and pg_dumpall as that seems to be the way people want to go.

I think this will be an exercise in time-wasting, and very possibly
destabilize *both* tools. pg_dump has never been designed to reconnect
to a different database; for instance there isn't any code for resetting
all the internal state that it gathers. I think forking a separate
pg_dump for each database is a perfectly fine arrangement, and should be
left alone.

regards, tom lane


From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-05 22:58:18
Message-ID: 459ED80A.7060300@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane schrieb:
> Dave Page <dpage(at)postgresql(dot)org> writes:
>> As far as I can see, adding a -f option to pg_dumpall should be straight
>> forward, the only issue being that we'd need to pass pg_dump an
>> additional (undocumented?) option to tell it to append to the output
>> file instead of writing it as normal.
>
> Wouldn't it be easier/better to re-point stdout at the -f file, and not
> touch pg_dump at all?

Yeah, and maybe have a modifier like %n or something which would instead
write different files and replaces %n with the name of the database...

Regards
Tino


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Dave Page <dpage(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-06 11:42:51
Message-ID: 200701061242.52049.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> In pgAdmin we use pg_dump's -f option to write backup files. The IO
> streams are redirected to display status and errors etc. in the GUI.
>
> In order to enhance the interface to allow backup of entire clusters
> as well as role and tablespace definitions, we need to be able to get
> pg_dumpall to write it's output directly to a file in the same way,
> because we cannot redirect the child pg_dump IO streams (which also
> means we may miss errors, but I need to think about that some more).

I don't understand this. Errors are sent to stderr, and the real output
is sent to stdout, where you can capture and save it. What is the
problem?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Dave Page <dpage(at)postgresql(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-06 20:28:39
Message-ID: 45A00677.6060706@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Dave Page wrote:
>> In pgAdmin we use pg_dump's -f option to write backup files. The IO
>> streams are redirected to display status and errors etc. in the GUI.
>>
>> In order to enhance the interface to allow backup of entire clusters
>> as well as role and tablespace definitions, we need to be able to get
>> pg_dumpall to write it's output directly to a file in the same way,
>> because we cannot redirect the child pg_dump IO streams (which also
>> means we may miss errors, but I need to think about that some more).
>
> I don't understand this. Errors are sent to stderr, and the real output
> is sent to stdout, where you can capture and save it. What is the
> problem?
>

On Windows at least, I cannot redirect stdout/stderr of child processes,
only the parent (ie. pg_dumpall) that is executed by pgAdmin (the
pg_dump processes just seem to hang, and the debugger reports a deadlock
with no other useful info).

I'm sure there is a way round this but a) it'll probably mean hacking
wxWidgets or pg_dump about in ways I'm sure Vadim or Tom would dislike,
and b) it would seem reasonable to offer similar functionality in
pg_dumpall to that already in pg_dump anyway.

Regards, Dave.


From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-08 21:33:42
Message-ID: 20070108213342.GZ12217@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jan 05, 2007 at 08:05:26PM +0000, Dave Page wrote:
> Andreas Pflug wrote:
> >Dave Page wrote:
> >>In pgAdmin we use pg_dump's -f option to write backup files. The IO
> >>streams are redirected to display status and errors etc. in the GUI.
> >>
> >>In order to enhance the interface to allow backup of entire clusters as
> >>well as role and tablespace definitions, we need to be able to get
> >>pg_dumpall to write it's output directly to a file in the same way,
> >>because we cannot redirect the child pg_dump IO streams (which also
> >>means we may miss errors, but I need to think about that some more).
> >>
> >>As far as I can see, adding a -f option to pg_dumpall should be straight
> >>forward, the only issue being that we'd need to pass pg_dump an
> >>additional (undocumented?) option to tell it to append to the output
> >>file instead of writing it as normal.
> >>
> >>Any thoughts or better ideas?
> >>
> >Use pgAdmin's "create script" funcion on the server.
>
> We said long ago we weren't going to replicate pg_dump functionality in
> pgAdmin - a brief discussion on the pgadmin-hackers list earlier
> indicates that people still feel the same way, and that time would be
> better spend fixing pg_dump/pg_dumpall.

It might make sense to provide a programmatic interface to pg_dump to
provide tools like pgAdmin more flexibility. But it certainly doesn't
make sense to re-create the dumping logic.

In terms of integrating pg_dumpall and pg_dump; I don't really care if
that happens, but I would like to see pg_dumpall supporting all the
options that pg_dump does (a quick diff shows that pg_dumpall is
currently missing support for -f, -F, -v, -Z, -C (which may or may not
make sense), -E, -n & -t (might not make sense), -U and -W (probably
OK).
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: Dave Page <dpage(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-08 23:09:27
Message-ID: 45A2CF27.8010109@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jim C. Nasby wrote:
>
>
> It might make sense to provide a programmatic interface to pg_dump to
> provide tools like pgAdmin more flexibility.
Are you talking about "pg_dump in a lib"? Certainly a good idea, because
it allows better integration (e.g. progress bar).
> But it certainly doesn't make sense to re-create the dumping logic.
>
> In terms of integrating pg_dumpall and pg_dump; I don't really care if
> that happens,
I can't make too much sense of integrating pg_dumpall anywhere. Dumping
a whole cluster is certainly much of a planned job, not an interactive
online one, because its output usually won't be usable except for
disaster recovery. Not much function to "re-create" here, single
exception is extracting cluster wide data, the -g option, that's why I
mentioned scripting. But apparently this didn't get into pgadmin svn any
more, so I need to retract this proposal.

Regards,
Andreas


From: Dave Page <dpage(at)postgresql(dot)org>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-09 08:39:31
Message-ID: 45A354C3.8060504@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andreas Pflug wrote:
> Not much function to "re-create" here, single
> exception is extracting cluster wide data, the -g option, that's why I
> mentioned scripting. But apparently this didn't get into pgadmin svn any
> more, so I need to retract this proposal.

Eh? Your SCRIPT code is still there - or do you mean something else?

Regards, Dave.


From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-09 10:50:05
Message-ID: 45A3735D.9050900@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> Andreas Pflug wrote:
>
>> Not much function to "re-create" here, single
>> exception is extracting cluster wide data, the -g option, that's why I
>> mentioned scripting. But apparently this didn't get into pgadmin svn any
>> more, so I need to retract this proposal.
>>
>
> Eh? Your SCRIPT code is still there - or do you mean something else?
>
No GetScript implementation for pgServer.

Regards,
Andreas


From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-11 19:36:42
Message-ID: 1168544202.5462.7.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, 2007-01-05 at 17:52 -0500, Tom Lane wrote:
> I think this will be an exercise in time-wasting, and very possibly
> destabilize *both* tools. pg_dump has never been designed to reconnect
> to a different database; for instance there isn't any code for resetting
> all the internal state that it gathers.

That is merely an implementation issue. The question of whether pg_dump
and pg_dumpall should be separate programs is a question of design,
IMHO.

I don't think they need to be integrated any time soon, but if we were
to design pg_dump and pg_dumpall from scratch, it seems more logical to
use a single program, and therefore that is the long-term direction I
think we should head in.

-Neil


From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-14 21:25:51
Message-ID: 1168809951.6174.41.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2007-01-11 at 14:36 -0500, Neil Conway wrote:
> I don't think they need to be integrated any time soon, but if we were
> to design pg_dump and pg_dumpall from scratch, it seems more logical to
> use a single program

On thinking about this some more, it might be useful to factor much of
pg_dump's logic for reconstructing the state of a database into a shared
library. This would make it relatively easy for developers to plug new
archive formats into the library (in addition to the present 3 archive
formats), or to make use of this functionality in other applications
that want to reconstruct the logical state of a database from the
content of the system catalogs. We could then provide a client app
implemented on top of the library that would provide similar
functionality to pg_dump.

Moving pg_dump's functionality into the backend has been suggested in
the past (and rejected for good reason), but I think this might be a
more practical method for making the pg_dump logic more easily reusable.

(While we're on the subject, this would also present a good opportunity
to make pg_dump's command-line interface a little more sane. I wonder if
pg_dump's syntax has gotten sufficiently complicated that some users
might prefer to specify behavior via a configuration file, rather than a
long string of command-line options.)

-Neil


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Page <dpage(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-15 15:13:16
Message-ID: 45AB9A0C.6000204@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Neil Conway wrote:
> On Thu, 2007-01-11 at 14:36 -0500, Neil Conway wrote:
>
>> I don't think they need to be integrated any time soon, but if we were
>> to design pg_dump and pg_dumpall from scratch, it seems more logical to
>> use a single program
>>
>
> On thinking about this some more, it might be useful to factor much of
> pg_dump's logic for reconstructing the state of a database into a shared
> library. This would make it relatively easy for developers to plug new
> archive formats into the library (in addition to the present 3 archive
> formats), or to make use of this functionality in other applications
> that want to reconstruct the logical state of a database from the
> content of the system catalogs. We could then provide a client app
> implemented on top of the library that would provide similar
> functionality to pg_dump.
>
> Moving pg_dump's functionality into the backend has been suggested in
> the past (and rejected for good reason), but I think this might be a
> more practical method for making the pg_dump logic more easily reusable.
>
>
>

I like this idea. For example, we might usefully map some of this to
psql \ commands, without having to replicate the underlying logic.

cheers

andrew


From: elein <elein(at)varlena(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Page <dpage(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-23 00:05:49
Message-ID: 20070123000549.GO8879@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jan 15, 2007 at 10:13:16AM -0500, Andrew Dunstan wrote:
>
>
> Neil Conway wrote:
> >On Thu, 2007-01-11 at 14:36 -0500, Neil Conway wrote:
> >
> >>I don't think they need to be integrated any time soon, but if we were
> >>to design pg_dump and pg_dumpall from scratch, it seems more logical to
> >>use a single program
> >>
> >
> >On thinking about this some more, it might be useful to factor much of
> >pg_dump's logic for reconstructing the state of a database into a shared
> >library. This would make it relatively easy for developers to plug new
> >archive formats into the library (in addition to the present 3 archive
> >formats), or to make use of this functionality in other applications
> >that want to reconstruct the logical state of a database from the
> >content of the system catalogs. We could then provide a client app
> >implemented on top of the library that would provide similar
> >functionality to pg_dump.
> >
> >Moving pg_dump's functionality into the backend has been suggested in
> >the past (and rejected for good reason), but I think this might be a
> >more practical method for making the pg_dump logic more easily reusable.
> >
> >
> >
>
> I like this idea. For example, we might usefully map some of this to
> psql \ commands, without having to replicate the underlying logic.

Don't we already do this with the .psqlrc file?

--elein


From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: "Neil Conway" <neilc(at)samurai(dot)com>, "Dave Page" <dpage(at)postgresql(dot)org>, "David Fetter" <david(at)fetter(dot)org>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: -f <output file> option for pg_dumpall
Date: 2007-01-23 00:36:14
Message-ID: 61547.24.211.165.134.1169512574.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

elein wrote:
> On Mon, Jan 15, 2007 at 10:13:16AM -0500, Andrew Dunstan wrote:
>>
>>
>> Neil Conway wrote:
>> >On Thu, 2007-01-11 at 14:36 -0500, Neil Conway wrote:
>> >
>> >>I don't think they need to be integrated any time soon, but if we were
>> >>to design pg_dump and pg_dumpall from scratch, it seems more logical
>> to
>> >>use a single program
>> >>
>> >
>> >On thinking about this some more, it might be useful to factor much of
>> >pg_dump's logic for reconstructing the state of a database into a
>> shared
>> >library. This would make it relatively easy for developers to plug new
>> >archive formats into the library (in addition to the present 3 archive
>> >formats), or to make use of this functionality in other applications
>> >that want to reconstruct the logical state of a database from the
>> >content of the system catalogs. We could then provide a client app
>> >implemented on top of the library that would provide similar
>> >functionality to pg_dump.
>> >
>> >Moving pg_dump's functionality into the backend has been suggested in
>> >the past (and rejected for good reason), but I think this might be a
>> >more practical method for making the pg_dump logic more easily
>> reusable.
>> >
>> >
>> >
>>
>> I like this idea. For example, we might usefully map some of this to
>> psql \ commands, without having to replicate the underlying logic.
>
> Don't we already do this with the .psqlrc file?
>

No. \ commands are implemented in C code.

cheers

andrew