[postgis-users] PostGIS synchronization between two computers

Ben Madin ben at remoteinformation.com.au
Mon Jul 27 14:45:09 PDT 2009


G'day Michael,

In a word - schema.

It takes a bit of planning / getting used to, but try creating a  
postgis schema before loading postgis :

CREATE LANGUAGE plpgsql;

CREATE SCHEMA postgis;

SET search_path TO postgis;

\i /usr/local/pgsql/share/lwpostgis.sql

\i /usr/local/pgsql/share/spatial_ref_sys.sql

ALTER DATABASE SET search_path TO public, postgis; -- actually, I  
normally create a project specific schema instead of using public

-- Do other data stuff!

When you want to pg_dump, use the -n public flag in your statement to  
dump the public schema only.

This also has the benefit of only needing to transfer a limited amount  
of data between machines, not duplicating the postgis functions etc.

An extension of this (I find very handy) is that if you have static  
data (topographic, political boundaries etc) put them into a third  
schema (topo) so that you are not having to back it up all the time -  
during field work you may only have limited access to a backup system  
(ie vv limited bandwidth in some countries) so you don't spend time  
and money backing up data that you won't change anyway.

good luck!

cheers

Ben



Then when you want
On 28/07/2009, at 3:23 AM, Michael Ewald wrote:

> I'm gearing up for research project and using a netbook for  
> fieldwork. I want to be able to move my postgis databases between my  
> office computer and the field netbook and back again after adding  
> data. I tried doing a pg_dump on the database and restoring on the  
> netbook or vise versa but the tables contain references to filepaths  
> that don't exist on the netbook (i.e. /opt/local/lib/postgresql83// 
> liblwgeom) creating a failure. My basic setup is pgsql and postgis  
> installed via MacPorts on OS X and postgis installed via apt-get  
> under Ubuntu (for the netbook).
>
> Has anyone developed a tool to sync? Anyone have any ideas on how I  
> could accomplish this sync without copying each row using python?
>
> Thanks for any suggestions.
>
> -Michael
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 

Ben Madin
REMOTE INFORMATION

t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome   WA   6725

ben at remoteinformation.com.au



							Out here, it pays to know...





More information about the postgis-users mailing list