Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Failed to determine postgresql version

Discussion in 'Database Discussion' started by IdleServ, Apr 17, 2018.

  1. mjagustinnn

    mjagustinnn Registered

    Joined:
    Feb 5, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manila Philippines
    cPanel Access Level:
    Website Owner
    How to know the current version of PostgreSQL?
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Code:
    postmaster --version
    Should give you the current version
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Stichting FreeSpeechTube

    Stichting FreeSpeechTube Member

    Joined:
    Nov 3, 2018
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    I'm trying to upgrade to a PostgreSQL newer than the 9.2 that comes with cPanel. As stated here, there is no official cPanel support for this (related feature request here), but I have no choice but to upgrade somehow because the only reason I'm even using this VPS server is to run PeerTube on it, and PeerTube requires a PostgreSQL >= 9.6.
    github.com/Chocobozzz/PeerTube/issues/1358#issuecomment-438258862

    I've tried to do what is mentioned under "These are the steps taken to upgrade:" in this post on this cPanel forum, but I basically have no idea what I'm doing and I have no proper manual or guide to get 9.6 up and running on CentOS, especially in a cPanel environment. Anyway, this is what I tried:

    Code:
    # wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
    # yum install pgdg-centos96-9.6-3.noarch.rpm
    # postgres --version
    postgres (PostgreSQL) 9.2.24
    # systemctl reload postgresql
    # postgres --version
    postgres (PostgreSQL) 9.2.24
    # systemctl stop postgresql
    # systemctl start postgresql
    # postgres --version
    postgres (PostgreSQL) 9.2.24
    # service postgresql stop
    Redirecting to /bin/systemctl stop postgresql.service
    # service postgresql start
    Redirecting to /bin/systemctl start postgresql.service
    # postgres --version
    postgres (PostgreSQL) 9.2.24
    # rpm -qa |grep post
    postgresql-9.2.24-1.el7_5.x86_64
    postgresql-libs-9.2.24-1.el7_5.x86_64
    cpanel-postgresql-libs-9.2.23-1.cp1176.x86_64
    postgresql-contrib-9.2.24-1.el7_5.x86_64
    cpanel-postgresql-9.2.23-1.cp1176.x86_64
    postgresql-server-9.2.24-1.el7_5.x86_64
    postgresql-devel-9.2.24-1.el7_5.x86_64
    # yum install postgresql96 postgresql96-devel postgresql96-libs postgresql96-server
    # service postgresql restart
    # postgres --version
    postgres (PostgreSQL) 9.2.24
    # yum remove postgresql postgresql-devel postgresql-libs postgresql-server
    # service postgresql restart
    Redirecting to /bin/systemctl restart postgresql.service
    Failed to restart postgresql.service: Unit not found.
    # cat /var/lib/pgsql/data/PG_VERSION
    9.2
    
    (From here I tried to just copy+paste the commands mentioned in the post that describes the steps to upgrade.)
    
    # mv /var/lib/pgsql/.bash_profile.rpmsave /var/lib/pgsql/.bash_profile
    # ln -sfn /etc/init.d/postgresql-10 /etc/init.d/postgresql
    # service postgresql initdb
    The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
    # chkconfig postgresql on
    error reading information on service postgresql: No such file or directory
    # cd /var/lib/pgsql; ln -sfn 10/backups; ln -sfn 10/data; ln -sfn 10/pgstartup.log
    ln: ‘./data’: cannot overwrite directory
    # cd /usr/bin
    # ln -sfn /usr/pgsql-10/bin/postgres
    # ln -sfn /usr/pgsql-10/bin/postmaster
    # ln -sfn /usr/pgsql-10/bin/pg_config
    # ln -sfn /usr/pgsql-10/bin/pg_ctl
    # ln -sfn /etc/alternatives/pgsql-pg_dump pg_dump
    # ln -sfn /etc/alternatives/pgsql-pg_dumpall pg_dumpall
    # ln -sfn /etc/alternatives/pgsql-pg_restore pg_restore
    # ln -sfn /etc/alternatives/pgsql-psql psql
    # postgres --version
    -bash: /usr/bin/postgres: No such file or directory
    I don't know; I guess now I have deleted PostgreSQL entirely. Man, it really would've been nice if I could've picked 9.6 or higher from a WHM list, as I can do with PHP versions. I did upvote the related feature request. Back to playing Don't Starve Together.
     
    #23 Stichting FreeSpeechTube, Nov 17, 2018
    Last edited by a moderator: Nov 17, 2018
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Stichting FreeSpeechTube


    I just tried installing PostgreSQL using the method mentioned in a 3rd party article Installing PostgreSQL 9.4 on CentOS 6 with cPanel 11 · guh.me - gustavo henrique's personal blog

    I did change a few things though:

    1. I'm using Centos 7.5 so I obtained the proper URL:
    Code:
    http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7.5-x86_64/
    2. I wanted 9.6 not 9.4 so I modified everything they're suggesting to reflect 9.6

    Once I was done updating the symlinks though postmaster is showing me the correct version:

    Code:
    [root@server pgsql]# postmaster --version
    postgres (PostgreSQL) 9.6.11
    [root@server pgsql]#
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice