Compiling and setting up postgres, followin the INSTALL file
./configure
I just ran configure with no customization.
Had to install readline support:
apt-get install libreadline5-dev
make (Debian has renamed Gnu make to just make)
su (if you use su -, you'll need to cd back to the directory where you unpacked the pg source)
If you don't have a user postgres, add it
adduser postgres
I didn't need to add the postgres user since that user allready exists from my previous 7.4 installation
make install
Create the folder for the database:
mkdir /usr/local/pgsql/data && chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
After initdb it's probably a good idea to take a backup of the data directory,
so that you can just copy in a fresh copy of the db cluster without running
initdb if the import fails.
Make sure your new database works
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data > /usr/local/pgsql/data/logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
Then, stop the postgres instance you started:
/usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data/
the -v ON_ERROR_STOP makes the import abort if any error is encountered, and using the -f flag to specify the file, instead of using <, makes psql output line numbers from the dump, when outputting error messages.
This step probably won't work without errors/notices.
At this point, this sequence of commands can come in handy:
/usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data/ exit rm -rf /usr/local/pgsql/data/ cp -r /usr/local/pgsql/data-backup/ /usr/local/pgsql/data chown -R postgres.postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data > /usr/local/pgsql/data/logfile 2>&1 &
First obstacle are these lines in the dump file:
CREATE ROLE postgres;
ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN;
I simply removed them from the dump file.
I also removed any modifications done to the template-databases.
I got an error from some of the functions which I had added from old contrib.
Since I don't actually use the functions this provides, I simply deleted this from the dump file.
psql:/tmp/pg74.sql:65031: ERROR: could not access file "$libdir/fuzzystrmatch": No such file or directory