Upgrade postgres

Table of Contents

Upgrading Postgres from 7.2 to 7.4 under Red Hat 8
GNU make
Uninstalling an RH package
Installing Postgres - 1 of 2
Installing bison
Installing Postgres - 2 of 2
Stopping Postgres
The Perl interface DBD::Pg V 1.31
Starting the server
Creating and dropping databases
Author
Licence

Upgrade postgres

Upgrading Postgres from 7.2 to 7.4 under Red Hat 8

I installed Postgres from the RH disks, so it was installed as a RH package.

After a fight with BitTorrent I managed to download 7.4 (under Windows), so these instructions explain how to remove an existing package, and install a non-packaged program.

GNU make

These instructions assume you are using GNU make. I call it make, while some packages call it gmake to clarity.

Uninstalling an RH package

The command line program is rpm, the RH package manager, but the GUI is fine, so let's use that:

Fire up GNOME menu/System Settings/Packages. Just click off the tick beside SQL Database Server, and click Update. That's it! Just let it run.

Installing Postgres - 1 of 2

Assume postgresql-7.4.tar.bz2 is in /tmp. Run:

	shell>cd /tmp
	shell>bunzip2 postgresql-7.4.tar.bz2
	shell>tar xvf postgresql-7.4.tar
	shell>cd postgresql-7.4
	shell>vim INSTALL
	shell>./configure

Observe closely - configure complains about the age (version) of bison, so we must install a more recent bison before proceeding.

Installing bison

Download bison from http://www.gnu.org.

Assume bison-1.875.tar.gz is in /tmp. Run:

	shell>cd /tmp
	shell>gunzip bison-1.875.tar.gz
	shell>tar xvf bison-1.875.tar
	shell>cd bison-1.875
	shell>vim INSTALL

Stop!

By default, INSTALL says, bison is installed in /usr/local/bin/, but we can see the old bison in /usr/bin/. So we must run configure with a option telling it to install into /usr/bin/, if that's in fact what we want. It's what I wanted, so (look carefully):

	shell>./configure --prefix=/usr

We don't use --prefix=/usr/bin, as you might expect. Continue:

	shell>make

If you are really, and I do mean really, not in a hurry, run:

	shell>make check

Finally:

	shell>make install

Installing Postgres - 2 of 2

We clean up from the 1st run of configure, just to be safe, and continue:

	shell>make distclean
	shell>./configure
	shell>make
	shell>make install

After this, just follow the instructions in INSTALL.

Stopping Postgres

The instructions in INSTALL say:

	/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &

We'll now use part of that line to stop the server.

	shell>cd /usr/local/pgsql/bin
	shell>./pg_ctl -D /usr/local/pgsql/data stop

The Perl interface DBD::Pg V 1.31

Download DBD-Pg-1.31.tar.gz from CPAN, into /tmp.

	shell>cd /tmp
	shell>gunzip DBD-Pg-1.31.tar.gz
	shell>tar xvf DBD-Pg-1.31.tar
	shell>cd DBD-Pg-1.31
	shell>perl Makefile.PL
	shell>make
	shell>make test
	shell>su
	shell>make install
	shell>exit

That's it!

Starting the server

	shell>su postgres
	shell>cd /usr/local/pgsql/bin
	shell>./pg_ctl start -D /usr/local/pgsql/data >logfile 2>&1 &

Creating and dropping databases

	shell>su postgres
	shell>cd /usr/local/pgsql/bin
	shell>createdb <some name>

and

	shell>dropdb <some name>

Author

Ron Savage.

Home page: http://savage.net.au/index.html

This POD was converted to HTML by /Perl.html#fancy-pom2.pl

  • Version: 1.01 01-Jun-2006

    This version disguises my email address.

  • Version: 1.00 11-Jan-2004

    Original version.

Licence

Australian Copyright © 2002 Ron Savage. All rights reserved.

	All Programs of mine are 'OSI Certified Open Source Software';
	you can redistribute them and/or modify them under the terms of
	The Artistic License, a copy of which is available at:
	http://www.opensource.org/licenses/index.html
 
Top of page