2.2.  Installation #

You will need PostgreSQL 9.1 or above. We assume that you have PostgreSQL already compiled and installed. Please note: Depending on your system configuration mostly you have to be logged in as the system superuser.

There are two ways to compile pgSphere. The first is to copy the sources into the contribution directory of PostgreSQL's source tree (POSTGRESQL_SRC/src/contrib). Then, change into POSTGRESQL_SRC/src/contrib. If the sources are not yet installed and the directory pg_sphere does not exist, take the gzipped pgSphere sources ( e. g., pg_sphere_xxx.tgz ) and run:

shell> tar -xzf path/to/pg_sphere_xxx.tgz
            

Now, change into the pg_sphere directory and run :

shell> make
            

and to install pgSphere :

shell> make install
            

The second way does not require the PostgreSQL sources but the configuration tool pg_config.

First unpack the pgSphere sources:

shell> tar -xzf path_to_pg_sphere_xxx.tgz
            

Now, change into the pg_sphere directory and run:

shell> make USE_PGXS=1 PG_CONFIG=/path/to/pg_config
            

To install pgSphere you have to run :

shell> make USE_PGXS=1 PG_CONFIG=/path/to/pg_config install
            

To check the installation change into the pg_sphere source directory again and run:

shell> make installcheck
            

The check status will be displayed. Please note, the check gives different results with different PostgreSQL-versions. Currently, the check should run without errors with PostgreSQL-version 8.4. Otherwise check the file regression.diff.