Thread: Problems with createdb.exe and createuser.exe

Problems with createdb.exe and createuser.exe

From
"Zhan Deng"
Date:

Hi,

 

I have a question regarding the PostgreSQL installation.

 

I installed PostgreSQL in silent mode successfully. I passed the following parameters into the postgresql:

 

Msiexec postgresql-8.2-int.msi" /l*v C:\\log4.txt /qb INTERNALLAUNCH=1 ADDLOCAL=server,psql,pgadmin,jdbc,npgsql SERVICEDOMAIN=%COMPUTERNAME% CREATESERVICEUSER=1 SERVICEACCOUNT=postgres SERVICEPASSWORD=pgservice SUPERPASSWORD=pgsuper BASEDIR=C:\postgres\postgresql-8.2.3

 

After the installation,  I was trying to run createdb.exe and createuser.exe utilities in a silent mode.  But they always ask me to enter the password.  Is there is a way that I can run them by passing the username/password from the command line without the prompting for entering password/interactive mode.

 

Thank you,

Zhan

 

 

 

 

 

 

Re: Problems with createdb.exe and createuser.exe

From
"Merlin Moncure"
Date:
On 5/29/07, Zhan Deng <zdeng@copanion.com> wrote:
> After the installation,  I was trying to run createdb.exe and createuser.exe
> utilities in a silent mode.  But they always ask me to enter the password.
> Is there is a way that I can run them by passing the username/password from
> the command line without the prompting for entering password/interactive
> mode.

You have a few options here:
* set PGPASSWORD environment variable, either for user/system
* entry into .pgpass in home folder
* alter pg_hba.conf to not require password under certain conditions

Basically, this is standard authentication configuration (check the
documentation).  How you do this has important security
considerations.  The documentation should give you all the answers
here.  What makes windows a bit peculiar is how you set environment
variables (set them permanently via the control panel) and the
location of the home folder (there is a trick to this which i forget).

merlin