Text Size: Normal / Large
This page in other versions: 9.2 / 9.1 / 9.0 / 8.4  |  Unsupported versions: 9.3 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1 / devel

Chapter 14. Installation Instructions

This chapter describes the installation of PostgreSQL from the source code distribution. (If you are installing a pre-packaged distribution, such as an RPM or Debian package, ignore this chapter and read the packager's instructions instead.)

14.1. Short Version

./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

The long version is the rest of this chapter.

Comments


2005-03-22 02:34:53.483664

How to do it in FreeBSD:

$ su
# cd /usr/ports/databases/postgresqlXX-server/ (replace XX with the version number)
# make install

{wait}

# cd /usr/local/pgsql/
# mkdir data
# chown pgsql data
# su - pgsql
$ /usr/local/bin/initdb -D /usr/local/pgsql/data
$ /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
$ /usr/local/bin/createdb test
$ /usr/local/bin/psql test

done.


2005-04-01 23:25:48.137924

The ODBC driver has been moved out of the PostgreSQL tree into a separate package. To get the ODBC driver code go to http://www.postgresql.org/ftp/odbc/versions/src/


2005-04-09 08:52:06.168631

How to do it in Gentoo:

$ su
# emerge postgresql

{wait}

# cd /var/lib/postgresql/
# mkdir data
# chown postgres data
# su - postgres
$ /usr/local/bin/initdb -D /usr/local/pgsql/data
$ cd /var/lib/postgresql/data/
$ pg_ctl start -D /var/lib/postgresql/data/ -l logfile
$ /usr/local/bin/createdb test
$ /usr/local/bin/psql test

For more infos:

HOWTO Configure Postgresql in Gentoo
------------------------------------
http://gentoo-wiki.com/HOWTO_Configure_Postgresql


2005-04-18 21:36:51.089861

On (Open)Darwin you can use DarwinPorts ( http://darwinports.opendarwin.org/ ) to install PostgreSQL8. After installing the port system itself (see: http://darwinports.opendarwin.org/docs/ch01s03.html ) you just type:

sudo port install postgresql8

Then you can add a user,
- on Mac OS X using NetInfo Manager (the easiest way to do this is to make a copy of the already existing mysql user and change this afterwards: choose a free uid and gid (I took 73) set the shell to some shell (for instance /bin/sh and the home to /usr/local/pgsql.

- If you're on OpenDarwin, you can use some of the available adduser scripts on the net ( for instance: download http://www.opendarwin.org/pipermail/hackers/attachments/20040615/d29608ba/adduser.bin from http://www.opendarwin.org/pipermail/hackers/2004-June/004307.html rename it to .tgz instead of .bin, unpack it, check it with a text editor, change permissions to make it executable, run it).

the rest is pretty much the same, you just have to change every "/usr/local/pgsql/" into "/opt/local" (this is the default location where darwinports installs everything) or whatever prefix you've chosen for darwinports. initdb f.i. resides here by default: /opt/local/bin/initdb . I think you get the idea.


2005-06-02 14:25:53.166602

On CentOS4 (RHES-4) use:
/var/lib/pgsql/data

rather than:
/usr/local/pgsql/data


2005-07-04 12:00:46.478434

Using darwinports on OS X: install with the server variant and a user named postgresql8 is automatically created.

sudo port install postgresql8 +server

this will install everything under /opt/local


2005-07-13 08:55:51.670151

The previous comment on how to do it in FreeBSD is not the usual way.

# su
# cd /usr/ports/databases/postgresql80-server/
# make install
As you wish add clean or distclean to the previous line.

Obviously creating the required folders and starting postgresql as the pgsql user should be left to the scripts provided by the port.

# echo "postgresql_enable=\"YES\"" >> /etc/rc.conf
# /usr/local/etc/rc.d/010.pgsql.sh initdb

To start it without doing a reboot
# /usr/local/etc/rc.d/010.pgsql.sh start

To create a database
# createdb mydb -U pgsql -O pgsql


2005-08-07 19:35:43.700759

In Debian the following packages are necessary.

libreadline4-dev
zlib1g-dev.


2005-09-11 22:17:34.417171

Redhat 7.3. mucho frustration with Readline:

Not sure what the magic bullet was, but I installed:

ncurses-devel
libtermcap-devel
readline-devel
zlib-devel

before config would get all the way through. I also added refs to the libs but I think the above was probably all it needed.


2005-09-30 04:00:18.563617

How to do it in debian:
#apt-get install postgresql
{wait and choose pg_data path}
//thats all!


2005-10-01 19:46:58.588454

Correction in debian install. You can't install PostgreSQL 8 in Debian Sarge (current stable) with default apt-get configuration. Instead It will install version 7.4.x.

(If you are beginner Debian user, don't try apt-get to install newest version. Compile it from sources)


2006-05-06 03:15:28.996296

Compiling from source worked fine for me on Sarge with postgresql-8.1.3.

Additional installs:

libreadline4-dev
zlib1g-dev
termcap-compat

Tweeks:

create a link from make to gmake

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group