python: subprocess.Popen and postgresql driving me batty -


a simple little arrangement:

psql = '/usr/bin/psql' database = 'mydb' script = 'foo.sql' p = subprocess.popen([psql, '-d', database, '-f', script], shell=true, stdout=subprocess.pipe, stderr=subprocess.pipe) stdout, stderr = p.communicate() exit = p.returncode 

but fails, saying fatal: database "user" not exist if it's running under user user , ignoring -d flag.

what gives?


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -