RE: proposal: pg_restore --convert-to-text - Mailing list pgsql-hackers

From Imai, Yoshikazu
Subject RE: proposal: pg_restore --convert-to-text
Date
Msg-id 0F97FA9ABBDBE54F91744A9B37151A51299506@g01jpexmbkw24
Whole thread Raw
In response to Re: proposal: pg_restore --convert-to-text  (Euler Taveira <euler@timbira.com.br>)
Responses RE: proposal: pg_restore --convert-to-text  ("José Arthur Benetasso Villanova" <jose.arthur@gmail.com>)
Re: proposal: pg_restore --convert-to-text  (Euler Taveira <euler@timbira.com.br>)
List pgsql-hackers
Hi,

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@sss.pgh.pa.us> escreveu:
> >
> > Euler Taveira <euler@timbira.com.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);
        else
            fn = -1;
    }
    else if (AH->FH)

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

--
Yoshikazu Imai


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pgsql: Avoid creation of the free space map for small heaprelations, t
Next
From: "Nagaura, Ryohei"
Date:
Subject: RE: Timeout parameters