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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(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:25:54
Message-ID: CAFj8pRDG_8p1u_p5uJk5iW0xiAGNHaqe5Y4Uaf_d4cvPkcv4_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so 25. 7. 2020 v 15:26 odesílatel vignesh C <vignesh21(at)gmail(dot)com> napsal:

> 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.
>
> + /* when first char is hash, ignore whole line */
> + if (*line == '#')
> + continue;
>
> If line starts with # we ignore that line, I feel this should be
> included in the documentation.
>

Good note - I wrote sentence to doc

+ <para>
+ The lines starting with symbol <literal>#</literal> are ignored.
+ Previous white chars (spaces, tabs) are not allowed. These
+ lines can be used for comments, notes.
+ </para>
+

> Regards,
> Vignesh
> EnterpriseDB: http://www.enterprisedb.com
>

Attachment Content-Type Size
pg_dump-filter-20200727.patch text/x-patch 8.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-07-27 05:28:09 Re: proposal: possibility to read dumped table's name from file
Previous Message Bharath Rupireddy 2020-07-27 04:43:43 Re: Parallel worker hangs while handling errors.