在linux上设置临时环境变量:
export PGPASSWORD = 'postgres'
若用python实现,错误的方法:
os.system("export PGPASSWORD='postgres'")
正确的方法:
os.environ['PGPASSWORD'] = 'postgres'
在linux上设置临时环境变量:
export PGPASSWORD = 'postgres'
若用python实现,错误的方法:
os.system("export PGPASSWORD='postgres'")
正确的方法:
os.environ['PGPASSWORD'] = 'postgres'