[postgis-users] Install PostGIS from a server script?

Stephen Woodbridge woodbri at swoodbridge.com
Mon Oct 10 16:59:40 PDT 2005

Charlie Savage wrote:
> Is it possible for a postgresql server to run a script stored on the 
> server, and not on a client?
> More specifically, I have a Linux server (running postgresql 8.1 beta2 
> and the CVS HEAD of postgis) and a Windows client.
>  From the windows client I would like to be able to create a database, 
> install POSTGIS, and then create various tables/objects and load data.
> I run into problems when trying to install postgis from the windows 
> client because obviously "psql -d [yourdatabase] -f lwpostgis.sql" 
> doesn't work because lwpostgis.sql is on the server (and even if it was 
> one the client it specifies $libdir/liblwgeom.dll instead of 
> $libdir/liblwgeom.so).
> Is it possible to do this, or is it disallowed for security reasons?

The solution might be pretty simple if you think about the problem a 
little differently. You can install postGIS into a template database, 
then when you create a new database use the template database that 
already has postGIS installed into it and the new database will inherit 
all of the functionality of the template database. You can do this with 
pgAdmin, so you should be able to do it from any client that has enough 

-Steve W.

More information about the postgis-users mailing list