Setup postgres with automatic table and user intitiallisation

Поиск
Список
Период
Сортировка
От Lodron, Gerald
Тема Setup postgres with automatic table and user intitiallisation
Дата
Msg-id E70FE8EA6EBE9241BDB4CA6D8D12E1D80144BD99BDA3@RZJC1EX.jr1.local
обсуждение исходный текст
Ответы Re: Setup postgres with automatic table and user intitiallisation  (Greg Smith <greg@2ndQuadrant.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: fluca1978@infinito.it
Дата:
Сообщение: rationale behind quotes for camel case?
Следующее
От: Emrul Islam
Дата:
Сообщение: Multi-tenancy in Postgres