Installing PostGIS on Greenplum Single Node Edition

One of the main reasons users switch from other relational databases to PostgreSQL is the advanced support for geographic objects included in the PostGIS extension.

Being PostgreSQL specialists at 2ndQuadrant, we have tried to investigate if it was possible (and how) to install PostGIS on the Greenplum Single Node edition. Let’s see how Marco Nenciarini, 2ndQuadrant consultant and a long time Debian developer, tried to do it.

Greenplum Single Node Edition (SNE) is a free version of the Greenplum database, one of the most advanced solutions for data warehousing and analytics, which is based on a shared nothing architecture and allows for data distribution and parallel processing on several nodes (servers).

The Single Node edition of Greenplum is a freely distributed version of Greenplum which can be installed on a single node. On a multi-processor architecture, Greenplum Single Node Edition allows to create multiple segments (usually one per core) and hence to take advantage of parallel processing. Greenplum Single Node Edition can be downloaded for free from the main website.

With Greenplum originally based on a PostgreSQL 8.2 branch, Marco downloaded the latest compatible version of PostGIS with PostgreSQL 8.2: version 1.4.2 (http://postgis.refractions.net/download/postgis-1.4.2.tar.gz).

The system we used was a CentOS Linux 5.5, running Greenplum Database 3.3.6.1. Following PostGIS requirements, we installed proj4 and GEOS (http://www.argeo.org/linux/argeo-el/5/gis/x86_64/).

yum install gcc
yum install make
rpm -Uvh http://www.argeo.org/linux/argeo-el/5/gis/x86_64/proj-4.7.0-1.el5.argeo.x86_64.rpm
rpm -Uvh http://www.argeo.org/linux/argeo-el/5/gis/x86_64/proj-devel-4.7.0-1.el5.argeo.x86_64.rpm
rpm -Uvh http://www.argeo.org/linux/argeo-el/5/gis/x86_64/geos-3.2.2-1.el5.argeo.x86_64.rpm
rpm -Uvh http://www.argeo.org/linux/argeo-el/5/gis/x86_64/geos-devel-3.2.2-1.el5.argeo.x86_64.rpm

Unfortunately, the plain configure/make/make install process for PostGIS did not work straight away. We mainly encountered two types of issues: configuration issues and compilation issues.

The workaround we have developed consists of:

  • a wrapper file for the pg_config file
  • a patch for PostGIS

(The files are attached to this entry)

Once you have downloaded and uncompressed PostGIS, patch the source code using the attached patch (0001-Fix-all-compile-issues.patch). Then place the modified pg_config file in the PostGIS source directory and launch:

./configure --with-pgconfig=$PWD/pg_config

Then:

make PERL=$(which perl)
make PERL=$(which perl) install

You can perform PostGIS regression tests with:

make PERL=$(which perl) check

Keep in mind that – due to some NOTICE messages raised by Greenplum (which complains about the lack of specification of the distribution key by PostGIS) the test results officially fail. A thorough look at the diff file shows that most of these errors are harmless and can be ignored. We will however continue to test the environment in the next weeks.

Please do not hesitate to let us and Greenplum know about your feedback, even here or on the community support forum. It would be great if PostGIS support could be integrated in Greenplum, and I am confident that Greenplum staff will be supportive.

For the moment we hope this patch will come useful.

Attachments:

wrapper script: pg_config
patch: 0001-Fix-all-compile-issues.patch
3 replies
  1. Kochubeev
    Kochubeev says:

    I have tried to repeat your installaton? but I am have 32 bit version of Greenplum
    And when I am invoke make PERL=$(which perl) then I am recieve this kind of message.
    I thing this is because i an still trying to cast int64 Datum from Greenplum to 32 bit pointer… Is it possible to fix it somehow? Or it is mandatory to use 64 bit Greenplum version?
    cc1: warnings being treated as errors
    lwgeom_functions_basic.c: In function ‘LWGEOM_accum’:
    lwgeom_functions_basic.c:1827: warning: cast to pointer from integer of different size
    lwgeom_functions_basic.c:1845: warning: cast to pointer from integer of different size
    lwgeom_functions_basic.c: In function ‘LWGEOM_collect_garray’:
    lwgeom_functions_basic.c:1960: warning: cast to pointer from integer of different size
    lwgeom_functions_basic.c: In function ‘LWGEOM_makeline_garray’:
    lwgeom_functions_basic.c:2168: warning: cast to pointer from integer of different size
    make[1]: *** [lwgeom_functions_basic.o] Error 1
    make[1]: Leaving directory `/usr/local/postgis-1.4.2/postgis’
    make: *** [postgis] Error 2

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *