BUG #2931: Can't capture pg_dump Password prompt - Mailing list pgsql-bugs

From Michael Schmidt
Subject BUG #2931: Can't capture pg_dump Password prompt
Date
Msg-id 200701250020.l0P0KD9N009076@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2931: Can't capture pg_dump Password prompt  (Magnus Hagander <magnus@hagander.net>)
List pgsql-bugs
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.

Incidentally, I also found that when pg_restore is run without any
parameters it hangs.  Shouldn't it close neatly with an error message?

Thanks for your time!

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2930: Hash join abyssmal with many null fields.
Next
From: Chris Dunlop
Date:
Subject: btree_delete_page_redo: lost target page