You have to change the pg_hba.conf
in your PostgreSQL Server
, If your using pgAdmin
then go to Tools > Server Configuration ->ph_hba.conf
and change ticked
Type's Method to trust

and restart PostgreSQL server
I strongly recommend you to use MD5
Quoted from pg_dump
-w
--no-password Never issue a password prompt. If the server requires password authentication and a password is not available by other means
such as a .pgpass file, the connection attempt will fail. This option
can be useful in batch jobs and scripts where no user is present to
enter a password.
-W
--password Force pg_dump to prompt for a password before connecting to a database.
This option is never essential, since pg_dump will automatically
prompt for a password if the server demands password authentication.
However, pg_dump will waste a connection attempt finding out that the
server wants a password. In some cases it is worth typing -W to avoid
the extra connection attempt.