How To Install PostgreSQL Ip4r

Home » CentOS » How To Install PostgreSQL Ip4r
CentOS 4 Comments

on the old PostgreSQL that comes with CentOS 6?
Ive asked google over and over and he wont tell me. :(
(im trying to install it as a requirement for NIPAP)

Jason

4 thoughts on - How To Install PostgreSQL Ip4r

  • I don’t think Postgres 8.4 has the infrastructure that ip4r extension requires.

    but the ip4r release notes suggest…

    make NO_EXTENSION=1
    make NO_EXTENSION=1 install

    then

    psql -f /path/to/ip4r.sql dbname

    to activate it in that dbname database. they also mention there’s quite a bit of stuff in ip4r that won’t work on pre-9.1 Postgres due to lack of indexing support.

  • ok, so I removed the default PostgreSQL install and installed it from the software collections..

    following the instructions at

    https://www.softwarecollections.org/en/scls/rhscl/rh-PostgreSQL95/

    and I get this

    [root@home1p /home/jason]$scl enable rh-PostgreSQL95 bash
    [root@HOME1P jason]# PostgreSQL-setup –initdb
    * Initializing database in ‘/var/opt/rh/rh-PostgreSQL95/lib/pgsql/data’
    * Initialized, logs are in
    /var/lib/pgsql/initdb_rh-PostgreSQL95-PostgreSQL.log
    [root@HOME1P jason]# service rh-PostgreSQL95-PostgreSQL start Starting rh-PostgreSQL95-PostgreSQL service: [ OK ]
    [root@HOME1P jason]# psql psql: FATAL: role “root” does not exist
    [root@HOME1P jason]#

    any ideas?

    Jason

  • the best way to install postgresqol, imho, is from the yum.PostgreSQL.com respoitory run by the PostgreSQL development group.
    you get your choice of any of the active versions (9.2, 9.3, 9.4, 9,5, and now 9.6), it has almost all of the add-ons available at your fingertips via yum, and its well integrated and well supported. It does require a few packages from the EPEL repository for some of the addon packages.

    quicky howto on installing 9.5.latest for CentOS 6 64bit…

    # First, (optional) create and mount a dedicated xfs file system at
    /var/lib/pgsql before beginning this, so all my databases are on it
    sudo yum -y install https://download.PostgreSQL.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-CentOS95-9.5-3.noarch.rpm
    sudo yum -y install PostgreSQL95-{server,contrib,devel} # install server and components
    sudo service postrgresql-9.5 initdb # initialize database cluster
    sudo service PostgreSQL-9.5 start # start database server
    sudo chkconfig PostgreSQL-9.5 on # set so db server always runs at boot
    sudo -u postgres psql -c “create user $USER superuser; create database $USER owner $USER”

    that last step gives your regular user a sql account with full database admin privs and creates a scratchpad database for them to log on with while doing admin stuff.

    now,

    sudo yum -y install ip4r95
    psql -c “create extension ip4r” somedatabase

    to install ip4r and enable it in somedatabase…