Re: Postgres architecture for multiple instances - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Postgres architecture for multiple instances
Date
Msg-id mcekh7$ivc$1@ger.gmane.org
Whole thread Raw
In response to Re: Postgres architecture for multiple instances  (Samuel Smith <pgsql@net153.net>)
List pgsql-general
Samuel Smith schrieb am 23.02.2015 um 05:21:
> I am stuck with redhat as the OS so I'll only have initdb. But this is a good point.
> I assume there is nothing wrong with having multiple postgres instances (clusters) all running under a
> single postgres user on different ports on the same machine?

No, there isn't. One important advantage of that is that you can do a PITR for each customer individually.
If you keep all your databases in a single instance/cluster you can only do PITR for all of them.
For a multi-tenant system I don't think that will be acceptable.

Another advantage is, that you can have control superuser access on a per-cluster basis

> But then what is the best way to handle connecting to an individual cluster  (local only for admin purposes) with
psql?  

psql uses several environment variables for the default connection information:

  http://www.postgresql.org/docs/current/static/libpq-envars.html

You can either create one shell script for each instance/cluster or use different OS users that have different default
environmentvariables - that would be closer to what you have now.  

Thomas

pgsql-general by date:

Previous
From: VENKTESH GUTTEDAR
Date:
Subject: : Getting error while starting the server
Next
From: Adrian Klaver
Date:
Subject: Re: : Getting error while starting the server