Also you could create a protected fileeg pgCONFIDENTIALwith the lines
yourusernameyourpasswd
and do
cat pgCONFIDENTIAL | pg_dump -u yourdb > dbdump.sql