Quote:
Originally Posted by hirenlad
I want to run multiple instance of postgresql in one machine.. Is it possible ?
|
Yes that is possible.
Quote:
|
I had tried to create two services on two different ports, like one is on 5432 and another one is 5433. The service on port 5432 get started and work correctly but the service on port 5433 get registered but not started and produced error like " The service did not report an error ".
|
Did you create a second data directory using initdb for the second service?
This is a rough sketch of installing two services:
For the first one:
1) initdb c:\Data\Postgres1
2) pg_ctl register -N pg1 -U postgres -P somepassword -D c:\Data\Postgres1 -o "-p 5432"
3) net start pg1
For the second one
1) initdb c:\Data\Postgres2
2) Edit c:\Data\Postgres2\postgresql.conf and change the port number to 5433
2) pg_ctl register -N pg2 -U postgres -P somepassword -D c:\Data\Postgres2
3) net start pg2
As an alternative to editing postgresql.conf you could also specify the port number when registering the service, but putting it into .conf is more reliable. See the manual for initdb and pg_ctl for more details
Note that the username (postgres) and the password relate to the
Windows user, not the database user.
Very important: you have to run initdb as that postgres (Windows) user otherwise the permissions on the data directory are not correct.
This is all very well documented in the manual: