I need to make a script in python that calls pg_restore to restore a database. So far I use a batch file that sets true password in PGPASSWORD and after the restore it sets garbage in the var.
My problem is that I have to create a environment variable with SET PGPASSWORD='password' but I can't expose the password in the environment because if there is an error in the restore, PGPASSWORD will have the true password.
Is there a way to send the restore command with the password, like one can do with firebird?
Using Windows XP/7/8 with PostgreSQL 9.x.
 
     
    