PG Bug reporting form <noreply@postgresql.org> writes:
> Assuming that we have the user u1 with the password p1, the following
> command:
> psql -U u1 'dbname=postgres password=p1' -W
> prompts for a password but the input password is effectively ignored.
The entire point of the -W switch is that it prompts whether or not
the password is going to be used for anything. If you don't like that,
don't use -W.
regards, tom lane