Peer Authentication Issues When using pg_dump

You can by pass password by editing pg_hba.conf and change from md5 to trust

It will work and never ask for password, however doing that it is not recommended for security concern