Installing PostgreSQL 9.1 on Fedora 15

posted Feb 19, 2012, 10:45 AM by Sachchida Ojha
1.  Download the Software

http://yum.postgresql.org/repopackages.php

2. Go to the download directory and verify the file.

[root@usha ~]# cd /home/oracle/Desktop/postgresql
[root@usha postgresql]# ls -ltr
total 8
-rw-r--r--. 1 oracle oinstall 5125 Feb 19 12:47 pgdg-fedora91-9.1-4.noarch.rpm
[root@usha postgresql]# chmod 755 pgdg-fedora91-9.1-4.noarch.rpm

3. Install the RPM Distribution

[root@usha postgresql]# rpm -ivh pgdg-fedora91-9.1-4.noarch.rpm
warning: pgdg-fedora91-9.1-4.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:pgdg-fedora91          ########################################### [100%]

4. Install PostgreSQL

a) List available packages
[root@usha postgresql]# yum list postgres*
Loaded plugins: langpacks, presto, refresh-packagekit
adobe-linux-x86_64                                       |  951 B     00:00    
adobe-linux-x86_64/primary                               | 1.2 kB     00:00    
pgdg91                                                   | 2.8 kB     00:00    
pgdg91/primary_db                                        |  49 kB     00:00    
pgdg91/group                                             |  674 B     00:00    
updates/metalink                                         |  16 kB     00:00    
updates                                                  | 4.5 kB     00:00    
updates/primary_db                                       | 6.6 MB     00:53    
adobe-linux-x86_64                                                          2/2
Available Packages
postgresql.i686                           9.0.6-1.fc15                   updates
postgresql.x86_64                         9.0.6-1.fc15                   updates
postgresql-contrib.x86_64                 9.0.6-1.fc15                   updates
postgresql-dbi-link.noarch                2.0.0-6.fc15                   fedora
postgresql-devel.i686                     9.0.6-1.fc15                   updates
postgresql-devel.x86_64                   9.0.6-1.fc15                   updates
postgresql-docs.x86_64                    9.0.6-1.fc15                   updates
postgresql-ip4r.x86_64                    1.05-2.fc15                    fedora
postgresql-jdbc.x86_64                    9.0.801-4.fc15                 updates
postgresql-libs.i686                      9.0.6-1.fc15                   updates
postgresql-libs.x86_64                    9.0.6-1.fc15                   updates
postgresql-odbc.x86_64                    09.00.0200-2.fc15              fedora
postgresql-odbcng.i686                    0.99.101-0.5.test1.fc15        fedora
postgresql-odbcng.x86_64                  0.99.101-0.5.test1.fc15        fedora
postgresql-pgpool-II.i686                 2.3.1-2.fc15                   fedora
postgresql-pgpool-II.x86_64               2.3.1-2.fc15                   fedora
postgresql-pgpool-II-devel.i686           2.3.1-2.fc15                   fedora
postgresql-pgpool-II-devel.x86_64         2.3.1-2.fc15                   fedora
postgresql-pgpool-ha.noarch               1.1.0-8.fc12                   fedora
postgresql-pgpoolAdmin.noarch             2.2-2.fc12                     fedora
postgresql-plparrot.x86_64                0.04-9.fc15                    updates
postgresql-plperl.x86_64                  9.0.6-1.fc15                   updates
postgresql-plpython.x86_64                9.0.6-1.fc15                   updates
postgresql-plruby.x86_64                  0.5.3-3.fc12                   fedora
postgresql-plruby-doc.x86_64              0.5.3-3.fc12                   fedora
postgresql-pltcl.x86_64                   9.0.6-1.fc15                   updates
postgresql-server.x86_64                  9.0.6-1.fc15                   updates
postgresql-table_log.x86_64               0.4.4-10.fc15                  fedora
postgresql-test.x86_64                    9.0.6-1.fc15                   updates
postgresql-upgrade.x86_64                 9.0.6-1.fc15                   updates
postgresql91.x86_64                       9.1.2-1PGDG.f15                pgdg91
postgresql91-contrib.x86_64               9.1.2-1PGDG.f15                pgdg91
postgresql91-debuginfo.x86_64             9.1.2-1PGDG.f15                pgdg91
postgresql91-devel.x86_64                 9.1.2-1PGDG.f15                pgdg91
postgresql91-docs.x86_64                  9.1.2-1PGDG.f15                pgdg91
postgresql91-libs.x86_64                  9.1.2-1PGDG.f15                pgdg91
postgresql91-odbc.x86_64                  09.00.0310-1PGDG.f15           pgdg91
postgresql91-odbc-debuginfo.x86_64        09.00.0310-1PGDG.f15           pgdg91
postgresql91-plperl.x86_64                9.1.2-1PGDG.f15                pgdg91
postgresql91-plpython.x86_64              9.1.2-1PGDG.f15                pgdg91
postgresql91-pltcl.x86_64                 9.1.2-1PGDG.f15                pgdg91
postgresql91-server.x86_64                9.1.2-1PGDG.f15                pgdg91
postgresql91-test.x86_64                  9.1.2-1PGDG.f15                pgdg91
postgresql_autodoc.noarch                 1.40-2.fc14                    fedora

b ) Install the PostgreSQL

[root@usha postgresql]# yum install postgresql91-server.x86_64
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql91-server.x86_64 0:9.1.2-1PGDG.f15 will be installed
--> Processing Dependency: postgresql91 = 9.1.2-1PGDG.f15 for package: postgresql91-server-9.1.2-1PGDG.f15.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql91-server-9.1.2-1PGDG.f15.x86_64
--> Running transaction check
---> Package postgresql91.x86_64 0:9.1.2-1PGDG.f15 will be installed
---> Package postgresql91-libs.x86_64 0:9.1.2-1PGDG.f15 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch        Version                 Repository   Size
================================================================================
Installing:
 postgresql91-server      x86_64      9.1.2-1PGDG.f15         pgdg91      3.2 M
Installing for dependencies:
 postgresql91             x86_64      9.1.2-1PGDG.f15         pgdg91      910 k
 postgresql91-libs        x86_64      9.1.2-1PGDG.f15         pgdg91      185 k

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 4.2 M
Installed size: 19 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 4.2 M
(1/3): postgresql91-9.1.2-1PGDG.f15.x86_64.rpm           | 910 kB     00:05    
(2/3): postgresql91-libs-9.1.2-1PGDG.f15.x86_64.rpm      | 185 kB     00:00    
(3/3): postgresql91-server-9.1.2-1PGDG.f15.x86_64.rpm    | 3.2 MB     00:25    
--------------------------------------------------------------------------------
Total                                           136 kB/s | 4.2 MB     00:31    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : postgresql91-libs-9.1.2-1PGDG.f15.x86_64                     1/3
  Installing : postgresql91-9.1.2-1PGDG.f15.x86_64                          2/3
  Installing : postgresql91-server-9.1.2-1PGDG.f15.x86_64                   3/3

Installed:
  postgresql91-server.x86_64 0:9.1.2-1PGDG.f15                                 

Dependency Installed:
  postgresql91.x86_64 0:9.1.2-1PGDG.f15                                        
  postgresql91-libs.x86_64 0:9.1.2-1PGDG.f15                                   

Complete!

5) Initialize the database

[root@usha postgresql]# cd /var/lib/pgsql/9.1/data/
[root@usha data]# service postgresql-9.1 initdb
Initializing database:                                     [  OK  ]

6) Set the database for automatic startup - If you want PostgreSQL to startup automatically on reboot

[root@usha data]# chkconfig postgresql-9.1 on

7) Start the database

[root@usha data]# service postgresql-9.1 start
Starting postgresql-9.1 (via systemctl):                   [  OK  ]
[root@usha data]#

===========================================================
start : start the database
stop : stop the database
restart : stop/start the database; used to read changes to core configuration files
reload : reload pg_hba.conf file while keeping database running
===========================================================

Removing

To remove everything:
yum erase postgresql-9.1*






Comments