[postgis-devel] 2 versions of PostGIS at same time for developing. How?

Nicklas Avén nicklas.aven at jordogskog.no
Sun May 2 04:44:24 PDT 2010


Hallo Jorge

You can absolute have different PostGIS version in different databases in the same instance. 
The sql-part of the functions tells tells what library to read from.

When I was working with the distance functions I even ran functions from different versions in the same query to compare the result easier in big datasets. If you want to do something like that you just install one version and then make another function with another name pointing to the other versions library.

To get one st_distance for instance from 1.5 and one from trunk you can install the 1.5 and then run:
CREATE OR REPLACE FUNCTION trunk_distance(geometry, geometry)
  RETURNS double precision AS
'$libdir/postgis-2.0', 'LWGEOM_mindistance2d'
  LANGUAGE 'c' IMMUTABLE STRICT
  COST 100;
ALTER FUNCTION trunk_distance(geometry, geometry) OWNER TO postgres;


then you can do queries like:

select st_distance(a.the_geom, b.the_geom) - trunk_distance(a.the_geom, b.the_geom) from .....

At least it works for most of the functions and can be very handy.

HTH
Nicklas


2010-05-02 Jorge Arevalo  wrote:

Hello,
>
>I'd like to test the code I'm developing (WKT Raster) with 2 versions
>of PostGIS: The stable branch (1.4 based) and the development branch.
>What would be the best way to do this? 2 instances of PostgreSQL
>running? spatially enable 2 postgresql databases with different
>versions of postgis? Is it possible?
>
>Thanks in advance, and best regards,
>Jorge
>
>----
>http://www.gis4free.org/blog
>_______________________________________________
>postgis-devel mailing list
>postgis-devel at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20100502/0f430079/attachment.html>


More information about the postgis-devel mailing list