Installing and setup Postgresql 9 on Fedora/CentOS/RHEL

April 2, 2011 | By Regaz | Filed in: Uncategorized.

This a step by step short guide on installing and setup PostgreSQL 9 on
Fedora/CentOS/RHEL

  1. Need to Setup right Repository for your OS:
    http://yum.pgrpms.org/reporpms/repoview/letter_p.group.html

    Install your repository by:
    a) Automatic package’s install than may show up if you download it with you browser
    b) If you use instead wget or curl or package’s install dosen’t work:

    $ rpm -Uhv http://yum.pgrpms.org/reporpms/9.0/pgdg-YOURDIST-9.XX.noarch.rpm
  2. Install PostgreSQL9
    $ yum groupinstall "PostgreSQL Database Server PGDG"

    The new PostgreSQL9’s layout is different from the previous version and
    here is a scheme of main directories involved:

    Executables: /usr/pgsql-9.0/bin
    Libraries: /usr/pgsql-9.0/lib (or /usr/pgsql-9.0/lib64)
    Documentation: /usr/pgsql-9.0/share/doc/postgresql-docs-x.y.z/html
    Contrib /usr/pgsql-9.0/share/pgsql/contrib
    Data: /var/lib/pgsql/9.0/data
    Backup area: /var/lib/pgsql/9.0/backups
    Templates: /usr/pgsql-9.0/share/pgsql
    Procedural Languages: /usr/pgsql-9.0/lib/pgsql or /usr/pgsql-9.0/lib64/pgsql
    Development Headers: /usr/pgsql-9.0/include/pgsql
    Other shared data: /usr/pgsql-9.0/share/pgsql
    Regression tests: /usr/pgsql-9.0/lib/pgsql/test/regress (in the -test package)
    or /usr/pgsql-9.0/lib64/pgsql/test/regress
    Documentation SGML: /usr/pgsql-9.0/share/doc/postgresql-docs-x.y.z/sgml

  3. Setup you System:

    Provide to login as root and make your installation working:

    a) Initialize your system by:

    # service postgresql-9.0 initdb

    b) Starting PostgreSQL:

    # service postgresql-9.0 start

    If you want an automatic startup on boot you need to execute this command:

    # chkconfig postgresql-9.0 on

    After that you will have a new created user “postgres” and you will need to setup a password by:

    # passwd postgress

    Then you can login as “postgres” and provide to create a database:

    $ su postgres
    $ createdb DATABASENAME

    After you can provide to execute postgreSQL on this database by login:

    $ psql
  4. Getting-Started Quickly with PostgreSQL on Fedora/CentOS:

    PostgreSQL Quick Start

Good Luck!
Davide


Tags: , , , ,

QuickChic Theme • Powered by WordPress