How to Install PostgreSQL Using the Source Code

Obtain the source code from PostgreSQL website ., Unpack the source code package.,Change the current directory to the newly created one (postgresql-8.3.3) , Configure the source tree for your system and choose the installation options you want...

13 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Obtain the source code from PostgreSQL website .

    Use the following bash/console command:gunzip postgresql-8.3.3.tar.gztar xf postgresql-8.3.3.tar postgresql-8.3.3 is the name of the current version.

    Future versions might differ in the
    8.3.3 part.

    A directory named postgresql-8.3.3 will be created under the current directory (the one you executed the above script from). ,,, This might take a few minutes depending on your hardware.

    The last line displayed should be:
    All of PostgreSQL is successfully made.

    Ready to install. ,,,,,,,
  2. Step 2: Unpack the source code package.

  3. Step 3: Change the current directory to the newly created one (postgresql-8.3.3)

  4. Step 4: Configure the source tree for your system and choose the installation options you want: Default Configuration: run the command./configure on your bash/console Custom Configuration (this is for advanced users only): you can set a lot of custom configuration options using command line options listed in the PostgreSQL documentation

  5. Step 5: Start the build process by executing the command linegmake in your console/bash.

  6. Step 6: Install PostgreSql files by executing the bash/console command:gmake install which will install the files to /usr/local/pgsql unless you used the --prefix=PREFIX command line option

  7. Step 7: in which case the files will be installed to the path specified by PREFIX

  8. Step 8: Create a super-user account for PostgreSQL by executing the following command in the bash console:adduser postgres

  9. Step 9: Create a directory to hold PostgreSQL data tree by executing the following commands in the bash console:mkdir /p01/pgsql/datachown postgres /p01/pgsql/data

  10. Step 10: Create PostgreSQL cluster by executing:su - postgres /usr/local/pgsql/bin/initdb -D /p01/pgsql/data

  11. Step 11: Start up the PostgreSQL server (postmaster process) by executing: /usr/local/pgsql/bin/postmaster -D /p01/pgsql/data >logfile 2>&1 &

  12. Step 12: Create a PostgreSQL database in the cluster by executing: /usr/local/pgsql/bin/createdb test

  13. Step 13: Log-in to the database using the psql command: /usr/local/pgsql/bin/psql test

Detailed Guide

Use the following bash/console command:gunzip postgresql-8.3.3.tar.gztar xf postgresql-8.3.3.tar postgresql-8.3.3 is the name of the current version.

Future versions might differ in the
8.3.3 part.

A directory named postgresql-8.3.3 will be created under the current directory (the one you executed the above script from). ,,, This might take a few minutes depending on your hardware.

The last line displayed should be:
All of PostgreSQL is successfully made.

Ready to install. ,,,,,,,

About the Author

P

Pamela Thomas

Enthusiastic about teaching cooking techniques through clear, step-by-step guides.

28 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: