You will only need Postgres and the latest OpenNSD Postgres driver to upgrade your system.
First, obtain the latest version, at the time of this writing that would be Release Candidate 2 from ftp://ftp.postgresql.org/pub/dev. Be sure to check the FTP archive link, as the Postgres FTP server may keep the RC2 file online after the final version has been released. And do not forget to use a mirror site.
Note: Remember, the Postgres team is doing some awesome programming, but they are not gods and release candidates are probably not the best choice for a production system... (although if you have the nerve/backups it will be helpful if you do run a production system on a release candidate version and report the bugs you find)
Because I am running a Redhat 6.2 system with the Postgres 7.0.3 RPM version, /usr/local/pgsql is conveniently free. If you have 7.0.3 installed at that location, I suggest you use /usr/local/psql. All command samples in this document use the /usr/local/psql location, to prevent all the cut-n-pasters out there from messing up their 7.0.3 version by mistake. The rest of the text assumes you are installing under pgsql.
su - cd /usr/local mkdir psql chown pascal.pascal pgsql (substitute the user name that will be compiling Postgres) su - pascal cd /usr/local/psql tar xzf /tmp/postgresql-7.1RC2.tar.gz mv postgresql-7.1RC2/* . rmdir postgresql-7.1RC2 |
Compiling Postgres is extremely simple. This section contains only a brief configuration guide. If you think you have some special needs, you should refer to the Postgres installation documentation. You must not compile Postgres as root. You can mess up your system big time of you do.
This procedure was borrowed from /usr/local/pgsql/INSTALL. There are some configuration options for ./configure that you may want to look at.
If you are not compiling under /usr/local/pgsql you MUST at least specify '--prefix=/usr/local/psql' (or wherever your source is)
'--with-pgport=5433' instead of 5432, because you'll get conflicts with 7.0.3 if you don't change the port. You can also use the -p option for the postmaster, or set the PGPORT environment variable
'--enable-locale' and '--enable-multibyte' for Unicode support
'--with-[perl && python && tcl && CXX] for native language support libs
'--with-openssl=DIRECTORY' so you can safely access your Postgres over the Net.
'--enable-syslog' for those of you who like to use syslog.
The simplest form would be:
./configure [--prefix=/usr/local/psql] [options...] gmake gmake install |
I decided to use a different user account for 7.1, this makes it much simpler to configure, start and stop the database service. This is not mandatory, but if you do not do it, you will probably make a deadly mistake somewhere along the line.
First you need to add the new Postgres user account, which will own the database files and server processes. I usually do not set a password on these accounts, I just 'su' into them when I need to.
su - adduser postgr71 mkdir /usr/local/psql/data chown postgr71.postgr71 /usr/local/psql/data su - postgr71 |
Now change .bash_profile (or .profile), the PATH must have '/usr/local/psql/bin' as its first entry. You must also add the PGDATA and PGPORT exports. My profile looks like:
PATH=/usr/local/psql/bin:$PATH:$HOME/bin export PGDATA=/usr/local/psql/data export PGPORT=5433 |
If your are feeling lucky, you can skip the test. But don't forget to start the postmaster.
su - postgr71 initdb pg_ctl -l logfile start createdb test psql test |
You will want to add this brand new postgres instance to your automated startup, for that please refer to your OS manual.
After and installing Postgres, you need to compile the latest postgres driver for OpenNSD. Get that from the sourceforge.net CVS repository:
cd /usr/local/aolserver (or whereever your aolserver source resides) cvs -d:pserver:anonymous@cvs.acs-pg.sourceforge.net:/cvsroot/acs-pg login cvs -z3 -d:pserver:anonymous@cvs.acs-pg.sourceforge.net:/cvsroot/acs-pg co driver-2.3 |
Now you need to change some parameters in driver-2.3/makefile (yes, that is makefile not Makefile). There are plenty of samples in the file, but these need your immediate attention:
PGLIB=/usr/local/psql/lib # Where your PG libraries are installed PGINC=/usr/local/psql/include # Where your PG includes are installed NSHOME=/home/aolserver # Where your AOLserver is installed NSINC=/usr/local/aolserver/include # Where you untarred AOLserver |
Making should be simple, error free and fast. After make you should copy the new driver to your AOLServer bin dir, but don't overwrite the original postgres driver!
cd /usr/local/aolserver/ make cp postgres.so /home/aolserver/bin/postgres71.so |
Now you are all set to convert the database.