Re: proposal: possibility to read dumped table's name from file

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: possibility to read dumped table's name from file
Date: 2020-07-27 05:28:09
Message-ID: CAFj8pRAFULXGyeu6mwWbDf=h54Z+qa8Lx2L0xN_VgY_ZNBUMLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ne 26. 7. 2020 v 21:10 odesílatel Justin Pryzby <pryzby(at)telsasoft(dot)com>
napsal:

> On Sat, Jul 25, 2020 at 06:56:31PM +0530, vignesh C wrote:
> > On Tue, Jul 14, 2020 at 12:03 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > >> I meant can this:
> > >> printf(_(" --filter=FILENAME read object name filter
> > >> expressions from file\n"));
> > >> be changed to:
> > >> printf(_(" --filter=FILENAME dump objects and data based
> > >> on the filter expressions from the filter file\n"));
> > >
> > > done in today patch
> >
> > Thanks for fixing the comments.
> > Few comments:
> > + /* use "-" as symbol for stdin */
> > + if (strcmp(filename, "-") != 0)
> > + {
> > + fp = fopen(filename, "r");
> > + if (!fp)
> > + fatal("could not open the input file \"%s\": %m",
> > + filename);
> > + }
> > + else
> > + fp = stdin;
> >
> > We could use STDIN itself instead of -, it will be a more easier
> > option to understand.
>
> I think "-" is used widely for commandline tools, and STDIN is not (even
> though
> it's commonly used by programmers). For example, since last year,
> pg_restore
> -f - means stdout.
>

yes, STDIN is used by programming languages, but it is not usual in command
line tools. And because it was used by pg_restore, then we should not use
new inconsistency.

Regards

Pavel

> --
> Justin
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tsunakawa.takay@fujitsu.com 2020-07-27 06:22:45 RE: Global snapshots
Previous Message Pavel Stehule 2020-07-27 05:25:54 Re: proposal: possibility to read dumped table's name from file