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

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: proposal: possibility to read dumped table's name from file
Дата
Msg-id 20200726191006.GK4286@telsasoft.com
обсуждение исходный текст
Ответ на Re: proposal: possibility to read dumped table's name from file  (vignesh C <vignesh21@gmail.com>)
Ответы Re: proposal: possibility to read dumped table's name from file  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
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.stehule@gmail.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.

-- 
Justin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk
Следующее
От: "Nasby, Jim"
Дата:
Сообщение: autovac issue with large number of tables