make postgresql 9.5 default on centos 7

Started by Steve Clarkover 8 years ago7 messagesgeneral
Jump to latest
#1Steve Clark
steve.clark@netwolves.com

Hi List,

I loaded 9.5 on CentOS 7 but by default every thing wants to use the default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and libraries are used.

Thanks,
Steve

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Melvin Davidson
melvin6925@gmail.com
In reply to: Steve Clark (#1)
Re: make postgresql 9.5 default on centos 7

On Fri, Aug 18, 2017 at 1:50 PM, Steve Clark <steve.clark@netwolves.com>
wrote:

Hi List,

I loaded 9.5 on CentOS 7 but by default every thing wants to use the
default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and
libraries are used.

Thanks,
Steve

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

*> Is there a simple way to fix this so the 9.5 version of tools and
libraries are used.*

*Have you looked at the PGPORT environment variable?*

*https://www.postgresql.org/docs/9.5/static/libpq-envars.html
<https://www.postgresql.org/docs/9.5/static/libpq-envars.html&gt;*

*Also *

*PATH=/usr/local/pgsql/bin:$PATH
export PATHhttps://www.postgresql.org/docs/9.1/static/install-post.html
<https://www.postgresql.org/docs/9.1/static/install-post.html&gt;*

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

#3Scott Marlowe
scott.marlowe@gmail.com
In reply to: Steve Clark (#1)
Re: make postgresql 9.5 default on centos 7

On Fri, Aug 18, 2017 at 11:50 AM, Steve Clark <steve.clark@netwolves.com> wrote:

Hi List,

I loaded 9.5 on CentOS 7 but by default every thing wants to use the default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and libraries are used.

As Melvin mentions, psql and most clients default to looking on port
5432 for PostgreSQL. You can either set $PGPORT envar to the port that
9.5 is running on, or edit the postgresql.conf for each service and
swap the ports listed, so that 9.2 runs on the new port (likely 5433)
and 9.5 runs on the default port of 5432.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Alexander Farber
alexander.farber@gmail.com
In reply to: Steve Clark (#1)
Re: make postgresql 9.5 default on centos 7

Hi Steve,

On Fri, Aug 18, 2017 at 7:50 PM, Steve Clark <steve.clark@netwolves.com>
wrote:

I loaded 9.5 on CentOS 7 but by default every thing wants to use the
default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and
libraries are used.

to use PostgreSQL 9.6 on CentOS 7 -

first delete the postgresql packages coming with CentOS 7 by using "yum
erase ...." command and then:

rpm -Uvh
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96-server
systemctl initdb postgresql-9.6
systemctl enable postgresql-9.6
systemctl start postgresql-9.6
systemctl status -l postgresql-9.6

Regards
Alex

#5Alexander Farber
alexander.farber@gmail.com
In reply to: Alexander Farber (#4)
Re: make postgresql 9.5 default on centos 7

Oops, one correction - instead of

systemctl initdb postgresql-9.6

please use

/usr/pgsql-9.6/bin/postgresql96-setup initdb

as explained at https://wiki.postgresql.org/wiki/YUM_Installation

Regards

Alex

#6Devrim GÜNDÜZ
devrim@gunduz.org
In reply to: Steve Clark (#1)
Re: make postgresql 9.5 default on centos 7

Hi,

On Fri, 2017-08-18 at 13:50 -0400, Steve Clark wrote:

I loaded 9.5 on CentOS 7 but by default every thing wants to use the default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and libraries
are used.

yum remove postgresql-*
yum reinstall postgresql95*

will do the trick. Please note that the second one will restart the database,
so make sure that you run these in a maintenance period.

The first command will remove all OS PostgreSQL packages. This is a required
step to remove actual binaries from OS. The second command will reinstall the
packages, and they will create alternatives entries for the binaries, etc.

Regards,
--
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

#7Scott Marlowe
scott.marlowe@gmail.com
In reply to: Devrim GÜNDÜZ (#6)
Re: make postgresql 9.5 default on centos 7

On Tue, Aug 22, 2017 at 12:44 PM, Devrim Gündüz <devrim@gunduz.org> wrote:

Hi,

On Fri, 2017-08-18 at 13:50 -0400, Steve Clark wrote:

I loaded 9.5 on CentOS 7 but by default every thing wants to use the default
9.2 version that comes with CentOS 7.

Is there a simple way to fix this so the 9.5 version of tools and libraries
are used.

yum remove postgresql-*
yum reinstall postgresql95*

will do the trick. Please note that the second one will restart the database,
so make sure that you run these in a maintenance period.

The first command will remove all OS PostgreSQL packages. This is a required
step to remove actual binaries from OS. The second command will reinstall the
packages, and they will create alternatives entries for the binaries, etc.

Centos and Yum have supported multiple versions of PostgreSQL for
quite some time now. Just change the ports in their respective
postgresql.conf files and start them up.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general