Re: Regarding installing & starting Postgres on Windows

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Vikram Patil <vpatil(at)actuate(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Regarding installing & starting Postgres on Windows
Date: 2009-08-20 21:37:00
Message-ID: 4A8DC1FC.8000105@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vikram Patil wrote:
>
> Hello ,
>
> I am trying to find a way to install PostgreSQL through my script/code
> . I don’t want to use installer provided on websites.
>
> I compiled source and and I installed in one directory , Now I am
> trying to register it as a service or start database server directly.
>
> I read in FAQs that I can start database server by revoking
> administrative rights. But how I can do that is not mentioned there.
>

create a Windows account specifically to run the server. this account
needs RunAsService privilege (or whatever thats called), and needs 'full
control' over the postgres DATA directory and its contents.

you can create the service something like this from a CMD shell, so I'm
sure you can migrate this to your installer's setup script methods...

NET USER Postgres xyzzy
\path\to\pg_ctl register -N PGSQL-8.3 -U Postgres -P xyzzy -D
\oath\to\pg\data
runas /user:Postgres "\path\to\initdb -D \path\to\data -E locale"

note that this Postgres user account needs to have full access to the
data directory (which it will create if it doesn't exist, in which case,
it needs write access to the parent dir)

I don't quite know the command line magic to grant that process 'Log On
As a Service' privileges, however.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message paulo matadr 2009-08-21 00:57:51 Enc: Res: Function for replace
Previous Message Sam Mason 2009-08-20 21:09:03 Re: Function for replace