[postgis-users] Install postgis on a different schema

Stephen Woodbridge woodbri at swoodbridge.com
Sat Oct 3 10:06:10 PDT 2009


Andrea Peri wrote:
> Hi,
> 
> I'm try-ing to install postgis (1.4) on a schema different from 'public'.
> There is some documentation on this ?
> 
> I notice che postgis.sql has some call on 'public' hardcoded,
> so I don't understand if is necessary to install some objects of postgis 
> on public .
> 
> 
> Many thx,

I take a slightly different approach in my databases, which is to allow 
postgis to install in public, then install all my data and stored 
procedures in another schema like "work".

createdb -U postgres -h localhost -T template_postgis mydatabase
psql -U postgres -h localhost mydatabase
-- create my "work" schema
create schema work;
-- set the session path to default to "work"
set search_path to work, public;
-- alter the database so future connections default to "work"
alter database mydatabase set search_path to work, public;
...
\q


This has the benefit that when I dump my schemas, I can reload them 
without pulling all the postgis stuff along with my data and processes. 
So, upgrades are greatly simplified, migrating the database to another 
instance of postgresql which might be a different version is not a headache.

YMMV,
   -Steve



More information about the postgis-users mailing list