Re: Fix initdb for path with whitespace and at char

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix initdb for path with whitespace and at char
Дата
Msg-id 29066.1398810473@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fix initdb for path with whitespace and at char  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: Fix initdb for path with whitespace and at char  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> This looks correct to me. popen() requires SYSTEMQUOTEs on Windows, like 
> system() does. We already use SYSTEMQUOTEs in some popen() calls, like 
> in pg_ctl, but initdb is missing them. get_bin_version function in 
> pg_upgrade is also missing it, as is the popen() call in COPY TO/FROM 
> PROGRAM command.

Yuck.

> Is there any situation where would *not* want to wrap the command in 
> SYSTEMQUOTEs? If there isn't, ISTM it would be better to create a 
> wrapper function, pgwin32_popen(), which adds the quotes instead of 
> sprinkling them into all callers. Even if we go around and fix all of 
> the callers now, we're bound to forget it again in the future.

We might forget to use the wrapper function too, if it has a nonstandard
name, no?  A better idea would be to redefine popen() and system() on
Windows.  It looks like we're already using a #define to redefine popen().
This approach would let us get rid of nonstandard notation for this
problem, instead of adding more.
        regards, tom lane



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Considerer Harmful Considered Harmful
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump --pretty-print-views