本文介绍了为Inno Setup执行的Postgres(psql)进程设置PGPASSWORD环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用Inno Setup在Postgres中创建一个表空间.
I needs to create a tablespace in Postgres with Inno Setup.
我已经在命令行上运行了
I had run this on the command line:
SET PGPASSWORD=P0stgres
"C:\Program Files\PostgreSQL\9.4\bin\psql.exe" -h localhost -p 5432 -U postgres -d postgres -c "CREATE TABLESPACE TABLETEST OWNER postgres LOCATION E'{app}\\PATHTEST\\Db'"
我在Inno Setup中尝试了此操作,但没有成功:
I tried this in Inno Setup, but it did not work:
[Run]
Filename: {sys}\cmd.exe; Parameters: "SET PGPASSWORD=P0stgres"
Filename: {sys}\cmd.exe; Parameters: ""C:\Program Files\PostgreSQL\9.4\bin\psql.exe" -h localhost -p 5432 -U postgres -d postgres -c "CREATE TABLESPACE TABLETEST OWNER postgres LOCATION E'{app}\\PATHTEST\\Db'""
致谢
推荐答案
我能够做到这一点.是一个小错误.正确的是:
I was able to do it work. Was a little mistake.The correct is:
[Run]
Filename: {cmd}; Parameters: "/K SET PGPASSWORD=P0stgres&""C:\Program Files\PostgreSQL\9.4\bin\psql.exe"" -h localhost -p 5432 -U postgres -d postgres -c ""CREATE TABLESPACE TABLETEST OWNER postgres LOCATION '{app}\PATHTEST\Db'""
这篇关于为Inno Setup执行的Postgres(psql)进程设置PGPASSWORD环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!