Hi
I programmed an application which uses postgres 9.0. Currently i am writing an installer for my application and wrote
myown GUI to set up postgres settings and i already install it ofer the original setup.exe with parameters. After that
iwant to create user roles and tables with psql.exe and have written 3 scripts:
-> one for creating user roles (create role statemenst bey superuser)
-> one for creating data bases (create table statements by superuser)
-> one for initializing data bases (insert statements by new role)
I have the problem that when i run my batch i always have to let the user type in the password, thats nasty... I also
triedPGPASSWORD but it does not work, it always prints that it is the wrong password...
MyBatchfileOfInstallingAndInitializingPostgres.bat [Superusername] [Superuserpassword] [DataBaseOwnerName]
[DatabaseownerPassword]
@echo off
%~d0
cd %~dp0
if not exist "%~dp09.0\bin\psql.exe" postgresql-9.0.4-1-windows_x64.exe --mode unattended --install_runtimes 0
--create_shortcuts0 --prefix "%~dp09.0" --datadir "%~dp09.0\data" --serverport 5432 --serviceaccount %1 --superpassword
%2--servicepassword %2
rem set PGPASSWORD=%2
"%~dp09.0\bin\psql.exe" -U %1 -p 5432 -f CreateUser.sql
"%~dp09.0\bin\psql.exe" -U %1 -p 5432 -f CreateDatabase.sql
echo Enter ReDeformUser password to initialize ReDeformDB
rem set PGPASSWORD=%4
"%~dp09.0\bin\psql.exe" -a -d "ReDeformDB" -U %3 -p 5432 -f Inserts.sql
Thanks for any help