2011/4/20 durumdara <durumdara@gmail.com>:
> Dear Everybody!
>
> I want to ask that have some way to install PGSQL 9.0 as two instances in
> one machine?
>
> Most important question. The OS is can be Windows or Linux.
>
> I asked this, because formerly we heard about a story. I cite this as I
> remember:
>
> We have some product, and in the only one server of the customer (Win) have
> a PG9.0 version installed.
> But the developer company lost in the space, only the software (must)
> working...
>
> We don't know the root password, and we don't want to hack it (the system
> must work).
> But we needed to install the our version of the PG what is also 9.0 (because
> of the new functions)...
> ...
>
> We want to prepare to same situations with learn about PG.
>
> With Firebird and MS-SQL this case is not problem, because on same machine
> we can install another instances with same version.
>
> But I don't know that is PG supports multiple instances with same version or
> not?
It is fully supported. They need to run on different ports (even if
they are on different IPs the port needs to be different as well), and
in different data directories, but other than that, it's fully
supported.
The graphical installer on Windows will, IIRC, only set up the first
instance, but you can use the commandline tools (initdb and pg_ctl
register) to set up the second instance yourself.
> Also interesting question are the "users".
>
> In our systems we create user for every real user. If they are 100, we have
> same number of db users.
>
> But if we want to server more database in one place, we may do conflict on
> users. For example: all of the databases have user JohnM.
>
> If we can do multiple instances, the problem is vanishing, because all have
> it's own user list.
>
> If we cannot, then only idea if have if we make prefix on usernames based on
> short dbname.
> For example:
> offer_db users: off_JohnM, off_MaryK
> press_db users: prs_JohnM, prs_TomR
You might want to look at the config parameter db_use_namespace - but
I wouldn't recommend using it, I've seen too many cases where it's
confused systems.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/