Is it asking for root password or postgres password? As I'm running the script as root, it's almost certainly asking for thepostgres user password.