drush sql-dump asking for password
I presume you are using postgres.

psql, the commandline tool that Drush uses to manipulate the database, has no provision to pass a password as a commandline option, so Drush cannot provide it even if it knows what it is.  You may set up a .pgpass file in your $HOME directory to supply the password; it should contain entries that look like this:

localhost:5432:*:www-data:PASSWORD


If you create this file, and insure that it is chmod 600, then psql will no longer prompt for the password.