[postgis-devel] Is it possible to get rid of platform specific lwpostgis.sql files?

Charlie Savage cfis at savagexi.com
Thu Sep 6 17:20:06 PDT 2007


The PostGis installation scripts generate different versions of 
lwpostgis.sql per platform.


For example, here is Affine defined on Linux and Windows:

CREATE OR REPLACE FUNCTION 
Affine(geometry,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8)
	RETURNS geometry
	AS '$libdir/liblwgeom.so.1.3', 'LWGEOM_affine'
	LANGUAGE 'C' IMMUTABLE STRICT;


CREATE OR REPLACE FUNCTION 
Affine(geometry,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8)
	RETURNS geometry
	AS '$libdir/liblwgeom.dll', 'LWGEOM_affine'
	LANGUAGE 'C' IMMUTABLE STRICT;


Notice the library names are different. However, if you look at other 
postgresql contrib modules they don't do this.

For example, here is a function from tsearch:


CREATE FUNCTION set_curdict(text)
	RETURNS void
	as '$libdir/tsearch2', 'set_curdict_byname'
	LANGUAGE C
	RETURNS NULL ON NULL INPUT;


Any chance that postgis can do this instead?  We have a variety of 
postgis servers on linux/windows/mac and need to keep them in sync.  To 
do this we run a diff script that analyzes each database. It will always 
point out differences in postgis_scripts_build_date since they are 
generated at different times:

CREATE OR REPLACE FUNCTION postgis_scripts_build_date() RETURNS text
         AS 'SELECT ''2007-08-25 19:17:24''::text AS version'
         LANGUAGE 'sql' IMMUTABLE;

Its easy enough for us to post process lwpostgis.sql on each platform to 
set a common build date.  But it would be nice to skip this step by 
having just one lwpostgis.sql file.

So any chance this could be changed?

Thanks,

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20070906/af294d9d/attachment.bin>


More information about the postgis-devel mailing list