I have found Gevel, a tool enabling the visualization of the content of the GiST indices in Postgres. In particular, I am interested to use it to visualize the RTree spatial index in PostGIS. Does it work with Postgres 2.0? Is there a simple way (not compiling from source) to get it to run (e.g., with postgis.app on Mac OSX?) Apparently, Gevel and the rtree-gist modules should now be part of the default Postgres distro as per the readme, but I cannot find any way to enable these.

EDIT: Following on from comments, if I have to build from source, do I have to build while building Postgis, or can I add gevel later.

  • I have recently installed Postgres 9.5 beta and neither rtree_gist nor gevel are in the postgresql-9.5beta2/contrib directory. I think the readme is a bit confusing on this. Having said that, I pulled from git and installed from source in a few minutes (on Centos 6.7, for what it is worth) and all the tests passed. I will post my steps, if you are interested -- basically, their instructions, with a few more details. In my experience, building from source on Mac is reasonably similar to linux, although setting up build essentials and the like is a bit more painful. Feb 16, 2016 at 7:21
  • It is gevel not gavel -- this confused me until coffee number two :-) Good find, though, it is an interesting package. Feb 16, 2016 at 7:23
  • Hi John, apologies for the confusion. Yes, please include your steps in the answers in the answers question, I would give it a try. Did you have to build the contrib packages WITH the postgis, or is this something that can be added retrospectively in a separate build (that would be my main question).
    – MartinT
    Feb 19, 2016 at 3:22
  • I am still keen to resolve this question...
    – MartinT
    Mar 9, 2016 at 22:53

1 Answer 1


To answer your main question, you can build this after you have build Postgres/Postgis. However, the crucial part is that you need to do all of this from the

The crucial step in building from source is that the process relies on a file, contrib-global.mk, which is found in the Postgres contrib package. This is what is meant by step one in the instructions, namely,

cd PGSQLSRC/contrib
wget http://www.sai.msu.su/~megera/postgres/gist/gevel/gevel-8.0.x.tar.gz
make install
make installcheck

So, having the Postgres source files and running everything from the contrib subdirectory is the key step. I used updatedb and locate contrib-global-mk to find its location. This file in turn links to other make files in the Postgres bin directory. Unfortunately, this process requires pulling the Postgres source and building it, which I suspect you want to avoid. In practice, it is a very easy build and does not require the fiddling with pre-requisites, gdal, geos, proj4, etc, that Postgis does. It is possible to use the config switch prefix to set a path to the build, so as not to interfere with any existing Postgres installation, eg,

./configure --prefix=/usr/local/pgsql-9.5-test/

after which building gevel should be trivial.

  • @Martin, I have documented what I did, but I fear it will not be to your liking. I am not an expert by any means on build tools, but have generally found Postgres very easy to build (Postgis somewhat less so -- though usually due to older version of geos or gdal interfering). I got to the above through trial and error rather than a deep understanding of the process, but it was actually quite painless, once I realized I need to do everything relative to Postgres src/contrib. Mar 10, 2016 at 14:12
  • Thank you so much John - great answer that should get me some way. I am unclear about the parrt about ./configure . Is this an environment wide swithc you issued before the build, or is it in the make file? I am also unsure about updatedb and contrib-global-mk. Otherwise, thanks heaps!
    – MartinT
    Mar 15, 2016 at 23:00
  • My understanding is that configure --prefix writes the makefile, and the value of prefix overrides anything else, so I suppose you can think of it as a pre-build environment wide switch. Apologies, updatedb is a linux utility for finding files and has nothing to do with Postgres, just a quick way to find out where my contrib-global.mk was installed. Mar 17, 2016 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.