As I mentioned in the previous post the RPMs are available on PostgreSQL FTP site and all of its mirrors.
- Select version of Postgres to Install
- Select Platform - Linux
- Select rpm / srpm
- Select Linux Flavour (redhat/fedora)
- Download RPMs Listed there
- Installing PGDG RPMs are as easy as installing any RPMs
rpm -ivh package_name.version.arch.rpm - Unless specified, on minor release upgrades (i.e., upgrading from 8.1.0 to 8.1.1 or 8.1.3, etc1), you may use usual RPM upgrade process :
rpm -Uvh package_name.version.arch.rpm - Please note that on every new major version upgrade, youhave to follow dump/reload sequence.
- rpm -ivh postgresql-libs-8.3.7-1PGDG.rhel5.i386.rpm
- rpm -ivh postgresql-debuginfo-8.3.7-1PGDG.rhel5.i386.rpm
- rpm -ivh postgresql-8.3.7-1PGDG.rhel5.i386.rpm
- rpm -ivh postgresql-devel-8.3.7-1PGDG.rhel5.i386.rpm
- rpm -ivh postgresql-docs-8.3.7-1PGDG.rhel5.i386.rpm
- rpm -ivh postgresql-server-8.3.7-1PGDG.rhel5.i386.rpm
- Open Terminal
- su - postgres (changes your identity from root user to postgreSQL super user)
- Move to /opt/PostgresPlus/8.3/bin using "cd /opt/PostgresPlus/8.3/bin"
- execute "initdb -D data" (creates the Cluster, a new directory named 'data')
- Start Cluster using "pg_ctl -D start"
- To Chech the status use "pg_ctl status"
- Login inside the Cluster using "psql" command (continue your work in DataBase)
- reload : to reload the server configurations
- restart : to restart (stop/start) Server
- To stop the Cluster use "initdb -D stop"
Now every time you need to go to /opt/PostGresPlus/8.3/bin folder to execute the commands like psql, pg_ctl, etc., instead of doing this activity every time we can set the environment variables like PATH, PGDATA, PGPORT in .bash_profile file of User (postgres User)
Steps to follow :
- open Terminal
- Login as postgres User
- open .bash_profile file using "vi .bash_profile"
- insert the Lines PATH=
PGDATA= PGPORT= and save the file - now you can run all postgres commands from any location from terminal as postgres user
No comments:
Post a Comment