Re: Compiling to RPM setup/filesystem layout - Mailing list pgsql-general

From Doug McNaught
Subject Re: Compiling to RPM setup/filesystem layout
Date
Msg-id m3lmnd6ztv.fsf@belphigor.mcnaught.org
Whole thread Raw
In response to Compiling to RPM setup/filesystem layout  (Gerald Gutierrez <gml1@coldresist.com>)
List pgsql-general
Gerald Gutierrez <gml1@coldresist.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

pgsql-general by date:

Previous
From: "Steve Wolfe"
Date:
Subject: Re: Compiling to RPM setup/filesystem layout
Next
From: "Steve Wolfe"
Date:
Subject: A question on EFFECTIVE_CACHE_SIZE