[postgis-devel] Tested postgis_restore.pl
dustymugs at gmail.com
Thu Dec 29 12:31:11 PST 2011
>> >>The default search_path is: userland, postgis, contrib
> Your database default ?
>> >>On the whole, the script works. But I'm finding that two PostGIS
>> >>1.5 functions are getting through to the userland schema.
>> >Only _after_ the call to postgis_restore.pl ?
> Could you please pass the -v switch to postgis_restore.pl and
> save stderr in a file ? It'd have a log of kept/skipped items.
Sure. I've attached the stderr from postgis_restore.pl.
>> >I guess the only way to do that would be dropping the
>> >'SET search_path' produced by pg_restore, right ?
>> For my setup, I have to alter the search_path to include the other
>> two schemas.
> Are you modifying the output of postgis_restore.pl ?
> How ? And why ?
I haven't modified the output of postgis_restore.pl yet. I will need
to change the search_path in the restore as that would be overriding
the default database search_path. Otherwise things such as the
following won't work as st_srid is in the postgis schema.
ALTER TABLE ... ADD CONSTRAINT ... CHECK (st_srid(geom) = ...)
In the end, I decided not to use postgis_restore.pl for upgrading my
production database servers. I just needed to use pg_restore to
extract the userland schema and then use sed to expand the search_path
and update PostGIS constraints (srid and geometrytype).
pg_restore -n userland -1 -O sandbox_gateway.backup | sed -e 's/SET
search_path = userland/SET search_path = userland,postgis,contrib/' -e
's/\.ndims(/\.st_ndims(/' -e 's/\.srid(/\.st_srid(/'
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 257973 bytes
Desc: not available
More information about the postgis-devel