Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfQWs-00047x-1a for pgsql-admin@arkaria.postgresql.org; Fri, 04 Jan 2019 14:32:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfQWq-0006OD-IP for pgsql-admin@arkaria.postgresql.org; Fri, 04 Jan 2019 14:32:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfQWq-0006O2-Ah; Fri, 04 Jan 2019 14:32:52 +0000 Received: from mout.perfora.net ([74.208.4.196]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfQWo-0006n8-0B; Fri, 04 Jan 2019 14:32:51 +0000 Received: from [192.168.1.101] ([98.169.208.73]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MdMQ9-1gw8CM3zxT-00IRkP; Fri, 04 Jan 2019 15:32:46 +0100 Message-ID: <5C2F6E8C.7070402@sqlexec.com> Date: Fri, 04 Jan 2019 09:32:44 -0500 From: MichaelDBA User-Agent: Postbox 5.0.25 (Windows/20180328) MIME-Version: 1.0 To: Erika Knihti-Van Driessche CC: pgsql-admin@lists.postgresql.org, pgsql-general@lists.postgresql.org Subject: Re: Multiple postgresql clusters with same version and separate binaries References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------020001070006050702090205" X-Provags-ID: V03:K1:wA6ug0z+WpX/9JlMh3Q6puE+45miZLGYYjro5MAvClAQeqVN1Du Nav3xBO+m6PK2PEDZZHEoz5SN1Tpdy49m8JU9vncfZkxELG+ZdgAVzbwGlJPjEsiAGtn/2X KdKgqF+AYpJ6/ayUIeSnAlsX+hzxwrNbd1h8FSETf9WVsoGpDrnTmBlWettsKpGCKzxPn3H jpSTTRbwSZV04YP12+MEA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9li9gwfoJuk=:/nZca0H7efPd3CCnL4/jdG ABNzne0eCElnqqZULCPp/1UR0ax/szByLLHWvSv4w6tWaqiBwtzQwD2IXLTGTTXs0eDw2Qibl //iuOFOEJtFNtVOaunhkbVq0SvKnLbUNj2RjWZax3dB/O09TnqTySM+yMnzRwMB3H9tloxqEh wUuXhOSvh4yuYXnPDiIj5MvA4Nute36bedSCs2+Tgq/l7wULeX3GOcj0VSTc1s/y0ldFBFj+x WM5oXQBcghx7Q8qXI6AQ0KbeQeOblQ6IPbCt3ugqWtyvGpyn3H4mt77tCenKurwiDRyFwMzYl p5tFTlwwfVOrL7fQ4Z8lUX53OfMTjs5r9LG/r6m1u0DlyEwnsOSb4p82pMbu7kw/G4Xdr6X3o 7gZ+OlranmhmmWfBXoGEtQ8zNJjYm7+rJ9H18SmEeWiZM8rbfmjudxBRr3xFSjTN3aYnW/11K FIMXdc80MzmQaHdXxvT97rPe+MW6eWIi7ugL22IsGl5zpTcUVfFh/RY6DqSnV7zYuC8+6FjZ/ /Bhvu4W84tbORgvpd5dZ5witqK0cuo+hROI8iDnaM2PPJPC7TARWfl47+avUwV57QntbQWDPf ZCF+XPAFrE4LMi0mfFyKHHHrAhM8aUdly605iSYAMAA+/FqdYR8UmIqXQFZcMUVllxlUqcv4d UAieJh0gAnRJqQhxRFGdpi9rlSS/r6BFl/8SuwDuP3lLRjACk8N/3YtE4wLJe/S0lV+GotnvA J3EL86OyfWF9yLVe6qZcnhZrZr/OnvYl42vVezqS4gha81nf/S7oDwdYImI= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------020001070006050702090205 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To put it simply: you cannot run different major versions of PostgreSQL with the same binaries. 3 things need to be separate. You named 2 of them: data directory and port. The 3rd one is separate binary locations for each PG cluster instance running on the same host. What I do is create a separate .profile_pgsql file for each PG cluster instance. This file contains all the stuff necessary to distinguish between multiple PG clusters. Here is an example for a specific Linux distro... export VERSION=9.6 export PGROOT=/usr/pgsql-$VERSION export PGBASE=/var/lib/pgsql/$VERSION export PATH=$PGROOT/bin:$PGROOT/share:$PATH export PGLIB=$PGROOT/lib export MANPATH=$PGROOT/share/man:$MANPATH export LD_LIBRARY_PATH=$PGROOT/bin:$PGBASE/share:$PATH export PGDATA=$PGBASE/data export PGPASSFILE=~/.pgpass export PGUSER=postgres export PGDATABASE=postgres export PGPORT=5432 Regards, Michael Vitale > Erika Knihti-Van Driessche > Friday, January 4, 2019 9:21 AM > Hi, > > I have 10+ postgresql clusters (v 9.6) running on one machine - each > having their own data directory and port. They all share same binaries > though, and this is now giving me some headache.. I cannot shutdown > all clusters at the same time, so upgrading them is quite impossible. > > I know that running several versions of postgres is possible on one > machine - I suppose this would also work out with same version running > on different locations, like /db1/PostgreSQL/10, /db2/PostgreSQL/10.. > etc..? Has anyone any experience with this kind of problem? > > All help and ideas appreciated! :-) > > Thanks, > Erika --------------020001070006050702090205 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit To put it simply: you cannot run different major versions of PostgreSQL with the same binaries. 3 things need to be separate.  You named 2 of them: data directory and port.  The 3rd one is separate binary locations for each PG cluster instance running on the same host.

What I do is create a separate .profile_pgsql file for each PG cluster instance.  This file contains all the stuff necessary to distinguish between multiple PG clusters.  Here is an example for a specific Linux distro...

export VERSION=9.6
export PGROOT=/usr/pgsql-$VERSION
export PGBASE=/var/lib/pgsql/$VERSION
export PATH=$PGROOT/bin:$PGROOT/share:$PATH
export PGLIB=$PGROOT/lib
export MANPATH=$PGROOT/share/man:$MANPATH
export LD_LIBRARY_PATH=$PGROOT/bin:$PGBASE/share:$PATH
export PGDATA=$PGBASE/data
export PGPASSFILE=~/.pgpass
export PGUSER=postgres
export PGDATABASE=postgres
export PGPORT=5432



Regards,
Michael Vitale

Friday, January 4, 2019 9:21 AM
Hi,

I have 10+ postgresql clusters (v 9.6) running on one machine - each having their own data directory and port. They all share same binaries though, and this is now giving me some headache.. I cannot shutdown all clusters at the same time, so upgrading them is quite impossible.

I know that running several versions of postgres is possible on one machine - I suppose this would also work out with same version running on different locations, like /db1/PostgreSQL/10, /db2/PostgreSQL/10.. etc..? Has anyone any experience with this kind of problem? 

All help and ideas appreciated! :-)

Thanks,
Erika

--------------020001070006050702090205--