Thread: pg_dump incorrect output in plaintext mode

pg_dump incorrect output in plaintext mode

From
Magnus Hagander
Date:
$ pg_dump -v postgres -Fc -t t > /dev/null
...
pg_dump: dumping contents of table t
...

but in plaintext:
$ pg_dump -v postgres -Fp -t t > /dev/null
pg_dump: creating TABLE t
pg_dump: restoring data for table "t"
pg_dump: dumping contents of table t
pg_dump: setting owner and privileges for TABLE t
pg_dump: setting owner and privileges for TABLE DATA t


In particular, the "restoring data" is obviously completely wrong. But
AFAICT, the "creating table" and "setting owner" etc are also wrong...

This is because pg_dump calls RestoreArchive(fout).

Do we need to pass down a parameter all the way down the functions to
tell them if they're restoring or not?


-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



Re: pg_dump incorrect output in plaintext mode

From
Alvaro Herrera
Date:
Excerpts from Magnus Hagander's message of mar ago 28 08:08:24 -0400 2012:

> In particular, the "restoring data" is obviously completely wrong. But
> AFAICT, the "creating table" and "setting owner" etc are also wrong...
>
> This is because pg_dump calls RestoreArchive(fout).
>
> Do we need to pass down a parameter all the way down the functions to
> tell them if they're restoring or not?

Hmm, but the info is already there, is it not?  Isn't AH->ropt->useDB
what you want?

As a translator, I'm not sure that I'm too happy with the idea of having
to translate double the number of strings in pg_dump ...

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: pg_dump incorrect output in plaintext mode

From
Tom Lane
Date:
Magnus Hagander <magnus@hagander.net> writes:
> but in plaintext:
> $ pg_dump -v postgres -Fp -t t > /dev/null
> pg_dump: creating TABLE t
> pg_dump: restoring data for table "t"
> pg_dump: dumping contents of table t
> pg_dump: setting owner and privileges for TABLE t
> pg_dump: setting owner and privileges for TABLE DATA t

I don't see anything particularly incorrect about that.  The point of
the --verbose switch is to track what pg_dump is doing, and if what
it's doing involves going through RestoreArchive(), why should we try
to hide the fact?
        regards, tom lane



Re: pg_dump incorrect output in plaintext mode

From
Magnus Hagander
Date:
On Tue, Aug 28, 2012 at 6:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> but in plaintext:
>> $ pg_dump -v postgres -Fp -t t > /dev/null
>> pg_dump: creating TABLE t
>> pg_dump: restoring data for table "t"
>> pg_dump: dumping contents of table t
>> pg_dump: setting owner and privileges for TABLE t
>> pg_dump: setting owner and privileges for TABLE DATA t
>
> I don't see anything particularly incorrect about that.  The point of
> the --verbose switch is to track what pg_dump is doing, and if what
> it's doing involves going through RestoreArchive(), why should we try
> to hide the fact?

"restoring data for table 't'" makes you think it's actuall restoring
things. It's not. That dumping is implemented by calling an internal
function called RestoreArchive() has to be an implementation detail...
It certainly confuses users that we say "restoring" when we're not
doing that...

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



Re: pg_dump incorrect output in plaintext mode

From
Tom Lane
Date:
Magnus Hagander <magnus@hagander.net> writes:
> On Tue, Aug 28, 2012 at 6:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I don't see anything particularly incorrect about that.  The point of
>> the --verbose switch is to track what pg_dump is doing, and if what
>> it's doing involves going through RestoreArchive(), why should we try
>> to hide the fact?

> "restoring data for table 't'" makes you think it's actuall restoring
> things. It's not. That dumping is implemented by calling an internal
> function called RestoreArchive() has to be an implementation detail...
> It certainly confuses users that we say "restoring" when we're not
> doing that...

Well, why don't we just s/restoring/processing/ in the debug message,
and call it good?
        regards, tom lane



Re: pg_dump incorrect output in plaintext mode

From
Magnus Hagander
Date:
<p dir="ltr"><br /> On Aug 28, 2012 9:59 PM, "Tom Lane" <<a
href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>>wrote:<br /> ><br /> > Magnus Hagander <<a
href="mailto:magnus@hagander.net">magnus@hagander.net</a>>writes:<br /> > > On Tue, Aug 28, 2012 at 6:42 PM,
TomLane <<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>> wrote:<br /> > >> I don't see
anythingparticularly incorrect about that.  The point of<br /> > >> the --verbose switch is to track what
pg_dumpis doing, and if what<br /> > >> it's doing involves going through RestoreArchive(), why should we
try<br/> > >> to hide the fact?<br /> ><br /> > > "restoring data for table 't'" makes you think it's
actuallrestoring<br /> > > things. It's not. That dumping is implemented by calling an internal<br /> > >
functioncalled RestoreArchive() has to be an implementation detail...<br /> > > It certainly confuses users that
wesay "restoring" when we're not<br /> > > doing that...<br /> ><br /> > Well, why don't we just
s/restoring/processing/in the debug message,<br /> > and call it good?<p dir="ltr">Sure, that would work for me... I
cango do that if there are no objections.<br /><p dir="ltr">/Magnus  

Re: pg_dump incorrect output in plaintext mode

From
Magnus Hagander
Date:
On Fri, Aug 31, 2012 at 2:05 PM, Magnus Hagander <magnus@hagander.net> wrote:
>
> On Aug 28, 2012 9:59 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>>
>> Magnus Hagander <magnus@hagander.net> writes:
>> > On Tue, Aug 28, 2012 at 6:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> >> I don't see anything particularly incorrect about that.  The point of
>> >> the --verbose switch is to track what pg_dump is doing, and if what
>> >> it's doing involves going through RestoreArchive(), why should we try
>> >> to hide the fact?
>>
>> > "restoring data for table 't'" makes you think it's actuall restoring
>> > things. It's not. That dumping is implemented by calling an internal
>> > function called RestoreArchive() has to be an implementation detail...
>> > It certainly confuses users that we say "restoring" when we're not
>> > doing that...
>>
>> Well, why don't we just s/restoring/processing/ in the debug message,
>> and call it good?
>
> Sure, that would work for me... I can go do that if there are no objections.

Done.

Are we "allowed" to backpatch things to 9.2 at this point that changes
strings for translators?

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



Re: pg_dump incorrect output in plaintext mode

From
Magnus Hagander
Date:
On Tue, Sep 4, 2012 at 3:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>>> On Aug 28, 2012 9:59 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>>>> Well, why don't we just s/restoring/processing/ in the debug message,
>>>> and call it good?
>
>> Are we "allowed" to backpatch things to 9.2 at this point that changes
>> strings for translators?
>
> Well, not being a translator I'm not sure that I get a vote.
> But I'd think this is too minor to justify back-patching it.

Probably - that's why I didn't even consider going back beyond 9.2.

Anyway; I'll just leave it at master.


-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



Re: pg_dump incorrect output in plaintext mode

From
Tom Lane
Date:
Magnus Hagander <magnus@hagander.net> writes:
>> On Aug 28, 2012 9:59 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>>> Well, why don't we just s/restoring/processing/ in the debug message,
>>> and call it good?

> Are we "allowed" to backpatch things to 9.2 at this point that changes
> strings for translators?

Well, not being a translator I'm not sure that I get a vote.
But I'd think this is too minor to justify back-patching it.
        regards, tom lane