postgresql - Scalable, SQL compliant, object-relational database management system ChangeLog

HOWTO


# PostgreSQL 8.4.2
# ================
# If you have trouble downloading it from the URL below, try here:
# http://wwwmaster.postgresql.org/download/mirrors-ftp?file=source%2Fv8.4.2%2Fpostgresql-8.4.2.tar.bz2

# Prerequisites:
# bison
# flex
# Perl
# readline
# zlib
# Python (optional)
# PAM (optional)
# OpenLDAP (optional)
#
OpenSSL (optional)

cd
test -f installed/postgresql-8.4.2.tar.bz2 &&
mv installed/postgresql-8.4.2.tar.bz2 .
test ! -f postgresql-8.4.2.tar.bz2 &&
wget http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/\
v8.4.2/postgresql-8.4.2.tar.bz2

# Verify tarball w/
md5sum:
echo "d738227e2f1f742d2f2d4ab56496c5c6  postgresql-8.4.2.tar.bz2" | md5sum -c

# Extract the tarball and clean up older versions
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "postgresql-*" -exec rm -r {} \;
tar xjvf ~/postgresql-8.4.2.tar.bz2
cd postgresql-8.4.2
test $UID = 0 && chown -R root:root .

# If you want PAM support pass --with-pam to configure
# If you want LDAP support pass --with-ldap to configure
# If you want OpenSSL support pass --with-openssl to configure
#
# For other info, see './configure --help' and read ./INSTALL

# Configure and build it
./configure
make

# Become root to install it
su

# Install it
make install

# Add /usr/local/pgsql/lib to /etc/ld.so.conf, if it's not already in there:
egrep -q "^/usr/local/pgsql/lib$" /etc/ld.so.conf > /dev/null 2>&1 ||
( echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf ; ldconfig )

# Create /etc/profile.d/postgresql.sh to update PATH and MANPATH
cat <<EOF > /etc/profile.d/postgresql.sh
#!/bin/sh
export PATH=/usr/local/pgsql/bin:\$PATH
export MANPATH=/usr/local/pgsql/man:\$MANPATH
EOF
chmod 755 /etc/profile.d/postgresql.sh

# Add a 'postgres' user and group
getent group | grep "^postgres:" > /dev/null 2>&1 || groupadd postgres
id postgres > /dev/null 2>&1 || useradd -g postgres postgres
usermod -d /usr/local/pgsql/data -s /bin/bash postgres

# Create a data directory
mkdir -p /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data

# As the 'postgres' user, create the initial database data, start
# postgres, create a 'test' database
# (see ./logfile after it's done)
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

# Become root again
exit

# If you have a recent version of Slackware that supports Sysv-init style
# init scripts, install the sample init-script
cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql
chmod 700 /etc/rc.d/init.d/postgresql
( cd /etc/rc.d/rc0.d ; ln -sf ../init.d/postgresql K02postgresql
  cd /etc/rc.d/rc6.d ; ln -sf ../init.d/postgresql K02postgresql
  cd /etc/rc.d/rc2.d ; ln -sf ../init.d/postgresql S98postgresql
  cd /etc/rc.d/rc3.d ; ln -sf ../init.d/postgresql S98postgresql
  cd /etc/rc.d/rc4.d ; ln -sf ../init.d/postgresql S98postgresql
  cd /etc/rc.d/rc5.d ; ln -sf ../init.d/postgresql S98postgresql )
#
# and then start it
/etc/rc.d/init.d/postgresql start

## If you don't/can't do it the SysV-init way, add something like this:
# /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
## or this
# /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
## to /etc/rc.d/rc.local

# The 'postmaster' daemon will log to /usr/local/pgsql/data/serverlog

# Now as the 'postgres' user again, create a test database, check out
# the shell, then quit (leaving you as root).  While in the shell,
# 'help' for help, to list all databases try '\l', to quit '\q'.
su - postgres
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
exit

# Become your non-root user again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/postgresql-*.tar.*
mv postgresql-8.4.2.tar.bz2 installed/


# If you ever want to uninstall PostgreSQL, this should do it:
cd
su
test -d src/postgresql-* && ( cd src/postgresql-* ; make uninstall )
/etc/rc.d/init.d/postgresql stop
killall postmaster
rm -r /usr/local/pgsql
userdel postgres
groupdel postgres
rm -f /etc/rc.d/rc?.d/???postgresql /etc/rc.d/init.d/postgresql
cp -a /etc/ld.so.conf /etc/ld.so.conf.old
cat /etc/ld.so.conf.old |
egrep -v "^\/usr\/local\/pgsql\/lib$" > /etc/ld.so.conf
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "postgresql-*" -exec rm -r {} \;
rm -f ~/installed/postgresql-*.tar.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EST -0500)
HOWTO last updated: 2010-03-10 7:36pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]