pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josi Perez (3T Systems) <josiperez3t@gmail.com>
To: pgsql-admin@postgresql.org
Subject: register a service in Windows
Date: Mon, 19 Apr 2010 12:44:16 -0300
Message-ID: <o2g76a181e91004190844nb1486569pbb81a08491d1fcf6@mail.gmail.com> (raw)

Hi,

I'm trying to start automatically 3 postgresql services in Windows without
success.

What I already do:
1) Install postgres8.4.2 binaries for Windows - ok, this service installs
automatically without any action mine;

2) Created 2 new clusters:
C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data5"  --encoding
'UTF8' --locale 'pt_BR.UTF-8' --username postgres
C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data7"  --encoding
'UTF8' --locale 'pt_BR.UTF-8' --username postgres

and changed the postgres.conf contained in each of these directories:
in C:\data5:  port=5430
in C:\data7:  port=5434

3) Started pg_ctl manually and worked with the clusters/databases inside
pgAdminIII, including port 5432:
C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data5" -N
postgres842w5430  -l logfile5430  start
C:\data7>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data7" -N
postgres842w5434  -l logfile5434  start

But, I want to start each cluster automatically.
1) If I try to register
C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl" register -N
"postgres842w5430" -D "C:\data5" -U postgres -P postgres

comes the message:
can not open the service manager

2) In regedit I can see:
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.4
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.4

but, how can I add a new service?
In Installations there is a key "Data Directory" - then, to start another
cluster I needed to install binary PostgreSQL again with new parameters?

3) I tried to left these commands at autoexec.nt without success.
4) I tried to use batchrun to add these commands at startup and worked, but
I needed an icon to stop the processes.

Help.
How can I start these 3 data base areas as a service in Windows?

Thanks in advance.
Josi Perez

view thread (4+ messages)  latest in thread

Message-ID: <o2g76a181e91004190844nb1486569pbb81a08491d1fcf6@mail.gmail.com>
Permalink:  ../o2g76a181e91004190844nb1486569pbb81a08491d1fcf6@mail.gmail.com/
Also on:    postgresql.org/message-id/o2g76a181e91004190844nb1486569pbb81a08491d1fcf6@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: josiperez3t@gmail.com
  Subject: Re: register a service in Windows
  In-Reply-To: <o2g76a181e91004190844nb1486569pbb81a08491d1fcf6@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox