Search Postgresql Archives

Setup postgres with automatic table and user intitiallisation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
Hi

I programmed an application which uses postgres 9.0. Currently i am writing an installer for my application and wrote my own GUI to set up postgres settings and i already install it ofer the original setup.exe with parameters. After that i want 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 tried PGPASSWORD 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_shortcuts 0 --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
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux