[postgis-users] Schema migration

James Sewell james.sewell at lisasoft.com
Tue Jun 10 23:36:11 PDT 2014


Hi All,

I'm migrating from a legacy PostGIS system to a new one, and I want to
locate PostGIS in the postgis schema at the same time.

Most of the time this works fine, but when people have defined things like:

CREATE TABLE metro (
    ogc_fid integer DEFAULT nextval('metro_ogc_fid_seq'::regclass) NOT NULL,
    wkb_geometry public.geometry,
    id numeric(6,0),
    CONSTRAINT enforce_dims_wkb_geometry CHECK
((public.st_ndims(wkb_geometry) = 2)),
    CONSTRAINT enforce_srid_wkb_geometry CHECK
((public.st_srid(wkb_geometry) = 4283))
);

the whole thing falls apart, as it looks specifically for public.geometry etc...

Can anyone think of a smart way of fixing this on the fly? I'm using
postgis_restore.pl, which means I'm using pg_restore, which means that
I can't edit the SQL as I have a binary dump.

I know I can fix manually on the source database (ALTER), or I can
import these tabels manually - but I am hoping there is a way to
automate this.

Cheers,



-- 

James Sewell,
PostgreSQL Team Lead / Solutions Architect
______________________________________


 Level 2, 50 Queen St, Melbourne VIC 3000

*P* (03) 8370 8000 * **W* www.lisasoft.com  *F*(03) 8370 8000

-- 


------------------------------
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this 
email is free of viruses or other defects. If you have received this 
communication in error, you may not copy or distribute any part of it or 
otherwise disclose its contents to anyone. Please advise the sender of your 
incorrect receipt of this correspondence.


More information about the postgis-users mailing list