Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fojzY-0008GX-KF for pgsql-admin@arkaria.postgresql.org; Sun, 12 Aug 2018 06:36:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fojzU-0000Xv-RA for pgsql-admin@arkaria.postgresql.org; Sun, 12 Aug 2018 06:36:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fojzU-0000Xn-G8 for pgsql-admin@lists.postgresql.org; Sun, 12 Aug 2018 06:36:40 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([2404:130:4080::4]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fojzP-00041L-0d for pgsql-admin@postgresql.org; Sun, 12 Aug 2018 06:36:37 +0000 Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz Received: from [IPv6:2406:e001:d01:1:c831:40d6:2611:1b7] (unknown [IPv6:2406:e001:d01:1:c831:40d6:2611:1b7]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 87DCC80AEE; Sun, 12 Aug 2018 18:36:25 +1200 (NZST) Subject: Re: pg_ctl pointing postgres 9.5.4 after installation of postgres 10 To: Debraj Manna , pgsql-admin References: From: Mark Kirkwood Message-ID: <1b4ee3f8-eeee-26e5-47dc-3f76c65118c9@catalyst.net.nz> Date: Sun, 12 Aug 2018 18:36:25 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk What I suspect has happened is that: - you have 10.4 installed - you have 9.5 *client only* (as a result of upgrade or manual removal of the server package) Examine /usr/lib/postgresql/, you will probably see a 9.5 and 10 directory (but the 9.5 one probably won't have a postgres binary). If you set PATH to have /usr/lib/postgresql/10/bin in front of everything else then you will get you 10.4 binaries. However this is a bit of a pain - I think you can make life simpler by using 'update-alternatives' to make postgres version 10 the default instead of 9.5 - or remove all the 9.5 packages (*but* if removing be careful that you really don't have any 9.5 databases under /var/lib/postgresql/9.5 first...otherwise you will be reaching for your backups - at this point I should ask you do have backups right)? So perhaps do a bit more investigation, and report back here before removing anything :-) regards Mark On 12/08/18 07:26, Debraj Manna wrote: > The same question I have asked in stackoverflow and dba.stackexchange, > I did not get any reply there also. > > 1. https://dba.stackexchange.com/questions/214671/pg-ctl-still-pointing-to-9-5-4-after-upgrade-to-postgres-10 > 2. https://stackoverflow.com/questions/51802990/pg-ctl-still-pointing-to-9-5-4-after-upgrade-to-postgres-10-in-ubuntu-14 > > > On Sun, Aug 12, 2018 at 12:32 AM, Debraj Manna > > wrote: > > Hi > > I have updated postgres from 9.5.4 to the latest 10.4. > > But after installation I am seeing > > support@platform1:/usr/bin$ ls -lah pg_ctl > lrwxrwxrwx 1 root root 34 Jun 13 08:59 pg_ctl -> > /usr/lib/postgresql/9.5/bin/pg_ctl > > The issue appears similiar to the one discussed here > https://stackoverflow.com/a/24763074/785523 > . > > To install postgres 10 I have followed the below steps:- > > |sudo add-apt-repository "deb > http://apt.postgresql.org/pub/repos/apt/ > trusty-pgdg main"| > > |wget --quiet -O - > https://www.postgresql.org/media/keys/ACCC4CF8.asc > | sudo > apt-key add -| > > |sudo apt-get update| > > |sudo apt-get install postgresql-10| > > Then performed the data migration using pg_upgrade and then > removed postgres 9.5 > > Now posgres -V is also failing with the below error > > support@platform1:/usr/bin$ postgres -V > The program 'postgres' is currently not installed. You can install > it by typing: > sudo apt-get install postgres-xc > > Can someone let me know what is wrong and how can I fix it? > >