Running initdb while logged in as Administrator user (Windows)

From: "Daniel Futerman" <daniel(dot)futerman(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Running initdb while logged in as Administrator user (Windows)
Date: 2008-09-18 17:29:27
Message-ID: 6ca02fc80809181029y2a2a4f9w43d02e57e8b755ba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm trying to develop an automated PostgreSQL installer for Windows that
uses a silent install of PostgreSQL and batch scripts to initialise the
database cluster (i.e. run initdb) and start/stop the db server. The install
shouldn't install as a service, so initdb needs to be run manually.

The problem I'm having is that initdb cannot be run as an Administrator
user, so I wrote a script that creates a new limited Windows user and I now
want to run initdb using this user, but while still logged in as the
Administrator user.
I've looked at using the RUNAS comand, but the user password has to be
inserted manually when using this. I've also tried to pipe in the password
using echo *** | RUNAS... where *** is the password, but this doesn't seem
to work.

I know there are some apps out there that function as alternatives to RUNAS
but some of them require licences, and I'm looking for a distributable
solution.

How does the PostgreSQL installer work around this when a new limited user
can be specified when installing as a service?

Thanks,
Daniel.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Drake 2008-09-18 18:14:43 Pg COnference: Call for Lightning Talks
Previous Message Gauthier, Dave 2008-09-18 12:42:07 Re: 8.3.3 stability ?