- unpack the pgSphere sources - which I got with:
wget http://pgfoundry.org/frs/download.php/2558/pgsphere-1.1.1.tar.gz
- change into the pg_sphere directory and run:
make USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config
- install pgSphere with:
make USE_PGXS=1 PG_CONFIG=/path/to/pg_config install
In my case I run:sudo make USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config install
- check the installation. Here the instruction to just run
make installcheck
proved inadequate.
- first of all, I had to run:
make USE_PGXS=1 installcheck
- when that complained with: psql: FATAL: role "mperdikeas" does not exist (it apparently picks the Linux user),
I had to ... (next steps)
- connected as the PostgreSQL superuser with:
pgsql -d template1 -U postgres
- create PostgreSQL user mperdikeas with:
CREATE USER mperdikeas WITH PASSWORD '****';
- then,
make USE_PGXS=1 installcheck
failed again with ERROR: permission denied to create database, so I had to ... (next step)
- grant the "create database" privilege to user "mperdikeas":
ALTER USER mperdikeas CREATEDB;
- then,
make USE_PGXS=1 installcheck
failed yet again with ERROR: permission denied to set parameter "lc_messages" so I had to ... (next step)
- grant "superuser" privilege to user "mperdikeas":
ALTER USER mperdikeas WITH SUPERUSER;
- and only then did:
make USE_PGXS=1 installcheck
succeed. However, 2 of the 11 tests failed
- to verify the pgSphere installation, I connected to the contrib_regression database:
psql -d contrib_regression -U mperdikeas
and executed a: select spoint(3.15, 3.15) ;
which should return something like the following: (0.0084073464102068 , -0.0084073464102068)
(1 row)