Re: Compiling to RPM setup/filesystem layout

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Gerald Gutierrez <gml1(at)coldresist(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Compiling to RPM setup/filesystem layout
Date: 2001-05-31 20:14:20
Message-ID: m3lmnd6ztv.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-ports

Gerald Gutierrez <gml1(at)coldresist(dot)com> writes:

> Unfortunately, I can't just "compile" since I need to be able to replace my
> current 7.0.3 installation, installed via RPMs. How do I go about this so I
> don't mess everything up (leftover files and such, in addition to the
> mandatory pg_dump) ? Also, how do I ensure that when future RPMs come out, I
> can just use the RPMs and upgrade a compiled version?

Here's my advice:

1) Compile 7.1.2, and do "make install". This will put the binaries,
libs, manpages etc in /usr/local/pgsql, which doesn't conflict with
the RPMs at all.
2) Do pg_dumpall on your 7.0.3 database (after making sure all users
are disconnected). Shut down the database.
3) Rename your current PG data directory, rather than blowing it away
(so you can easily go back to 7.0.3 if you have trouble). This
assumes, of course, that disk space is plentiful.
4) Make a new PG data directory, set ownership and mode to
postgres:postgres:700.
5) Log in as 'postgres' and set the following environment variables:

export PATH=/usr/local/pgsql/bin:$PATH
export PGDATA=<wherever your PGDATA lives>
export LD_LIBRARY_PATH=/usr/local/pgsql/lib

6) You should then be able to do 'initdb $PGDATA' and initialize the
database.
7) Run 'pg_ctl start' to fire up the new postmaster.
8) Do 'psql -f <dumpfile> template1' to load the old data.
9) You'll have to either modify /etc/rc.d/init.d/postgresql to start
the new binary, or disable it and roll your own.

Client applications need to have LD_LIBRARY_PATH (and possibly PATH as
well) set so they look in the right place for stuff; otherwise they
will pick up old libs as long as the RPMs are still installed.

Once this is working, you can remove the RPMs if you want, or just
leave them around until you're ready to do an RPM upgrade.

Upgrading to 7.1.2 RPMs *should* be relatively straightforward, and
not require an initdb, unless you've done something weird when
configuring the source.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-05-31 20:16:20 Re: Compiling to RPM setup/filesystem layout
Previous Message pgsql-general 2001-05-31 20:13:17 PostgreSQL: The elephant never forgets UPDATE

Browse pgsql-ports by date

  From Date Subject
Next Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-05-31 20:16:20 Re: Compiling to RPM setup/filesystem layout
Previous Message Gerald Gutierrez 2001-05-31 19:59:35 Compiling to RPM setup/filesystem layout