RE: proposal: pg_restore --convert-to-text

From: "Imai, Yoshikazu" <imai(dot)yoshikazu(at)jp(dot)fujitsu(dot)com>
To: 'Euler Taveira' <euler(at)timbira(dot)com(dot)br>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andreas Karlsson <andreas(at)proxel(dot)se>, "Andrew Gierth" <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: proposal: pg_restore --convert-to-text
Date: 2019-02-28 02:48:22
Message-ID: 0F97FA9ABBDBE54F91744A9B37151A51299506@g01jpexmbkw24
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Tue, Feb 19, 2019 at 8:20 PM, Euler Taveira wrote:
> Em seg, 18 de fev de 2019 às 19:21, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:
> >
> > Euler Taveira <euler(at)timbira(dot)com(dot)br> writes:
> > > Since no one has stepped up, I took a stab at it. It will prohibit
> > > standard output unless '-f -' be specified. -l option also has the
> > > same restriction.
> >
> > Hm, don't really see the need to break -l usage here.
> >
> After thinking about it, revert it.
> > Pls add to next CF, if you didn't already.
> >
> Done.

I saw the patch.

Is there no need to rewrite the Description in the Doc to state we should specify either -d or -f option?
(and also it might be better to write if -l option is given, neither -d nor -f option isn't necessarily needed.)

I also have the simple question in the code.

I thought the below if-else condition

+ if (filename && strcmp(filename, "-") == 0)
+ fn = fileno(stdout);
+ else if (filename)
fn = -1;
else if (AH->FH)

can also be written by the form below.

if (filename)
if(strcmp(filename, "-") == 0)
fn = fileno(stdout);
fn = -1;
else if (AH->FH)

I think the former one looks like pretty, but which one is preffered?

Yoshikazu Imai

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Nagaura, Ryohei 2019-02-28 03:07:05 RE: Timeout parameters
Previous Message Amit Kapila 2019-02-28 02:40:28 Re: pgsql: Avoid creation of the free space map for small heap relations, t