Re: BUG #2931: Can't capture pg_dump Password prompt

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: BUG #2931: Can't capture pg_dump Password prompt
Дата
Msg-id 45BB787D.5040801@hagander.net
обсуждение исходный текст
Ответ на BUG #2931: Can't capture pg_dump Password prompt  ("Michael Schmidt" <MichaelMSchmidt@msn.com>)
Список pgsql-bugs
Michael Schmidt wrote:
> The following bug has been logged online:
>
> Bug reference:      2931
> Logged by:          Michael Schmidt
> Email address:      MichaelMSchmidt@msn.com
> PostgreSQL version: 8.2
> Operating system:   Windows XP Pro
> Description:        Can't capture pg_dump Password prompt
> Details:
>
> I have a Java user app that allows database backup and restore by accessing
> pg_dump and pg_restore.  With PostgreSQL version 8.1, I was able to capture
> the Password: prompt on stderr, which allowed me to send to password at the
> proper time.  This no longer works with PostgreSQL 8.2.  I've worked on this
> for three days and even wrote a separate Java app to test various PostgreSQL
> utilities, posting results on the General list (got no help there).  I
> further confirmed the behavior by redirecting stderr from Windows cmd.exe.
> Although the password prompt appears on the screen, it does not appear to be
> in either stdout or stderr.  For Windows command prompt, the following was
> used:
> pg_dump.exe -Upostgres --host=localhost --port=5432 -W -v
> --file=E:\Backup\test.bak npbase 2>>log.txt
>
> As expected from using -v, a nice log of output was present in log.txt but
> not the "Password: " prompt.  I will supply the Java test app if you like.
>
>
> If the prompt is, in fact, being output on stderr, it cannot be accessed
> from either cmd.exe or Java.  If it has been changed, documentation on how
> to access it would be useful for app developers.

This is not a bug, it's a feature ;-) It's written to the console, not
to the standard stream. If you launch the tools externally and want to
pass the password, you should either use the pgpass.conf file, or set
the PGPASSWORD (this is safe on Win32).

//Magnus

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #2934: INSTALL FAILURE - failed to set permissions
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #2934: INSTALL FAILURE - failed to set permissions