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

Jorge Arevalo jorgearevalo at gis4free.org
Mon May 3 02:06:37 PDT 2010


On Sun, May 2, 2010 at 1:44 PM, Nicklas Avén <nicklas.aven at jordogskog.no> wrote:
> 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
>
Many thanks Nicklas! I tested it this weekend an seems to work fine for me.

Best regards,
Jorge



>
> 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
>>
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>



More information about the postgis-devel mailing list