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
Post a Comment