Having problem with authentication failed using postgresql and you know your .pgpass is correct? Try using -U to indicate user. Example:
pg_dump -U postgres db_name | gzip > /backup.gz