Peter E. can you look at this? I see simple prompt doing:
fputs(prompt, stdout);
which I think should be stderr. Peter, can you check on those?
>
> Does it still make sense to send the following to
> pgsql-bugs@postgresql.org?
>
> - Scott Williams
>
>
> Subject: pg_dump -u prompts for username/password on stdout rather than stderr
> ----------------------------------------------------------------------
> Your name : Scott Williams
> Your email address : Scott@James.com
>
>
> System Configuration
> ---------------------
> Architecture (example: Intel Pentium) : i586
> Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.10
> PostgreSQL version (example: PostgreSQL-6.5.3): PostgreSQL-6.5.3
> Compiler used (example: gcc 2.8.0) : egcs-2.91.66 19990314 (egcs-1.1.2 release)
>
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> When running pg_dump with the -u switch, it prompts me on stdout for
> the username and password, rather than stderr. Unfortunately this
> causes a bit of confusion when doing
>
> pg_dump -o -u some_db >dump_file
>
> since it puts the prompt in the dump_file rather than to the screen,
> making dump_file syntacticly invalid. Of course the work around is
> to use the `-f' flag. However, redirecting pg_dump's stdout to a
> file using `>' is what's shown under `Usage' in the pg_dump chapter
> of the `PostgreSQL User's Guide'
>
>
> Please describe a way to repeat the problem. Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
>
>
-- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026