Re: [postgis-users] postgresql8.0 and postgis1.0.0 - Mailing list pgsql-general
From | Obe, Regina DND\\MIS |
---|---|
Subject | Re: [postgis-users] postgresql8.0 and postgis1.0.0 |
Date | |
Msg-id | B318FD8D29DCD411BD0500D0B7A91C6704103C6A@jupiter Whole thread Raw |
List | pgsql-general |
The short answer is that you leave out all the postgis function calls in your dump, create a new database and load the postgis functions using the new scripts. Then you just load the data. I didn't find an easy way to selectively load tables and views using the .sql format (and I actually didn't want to bring over some old junky tables I had) so I opted for the dumping using .tar format. Not sure if this is the easiest way, but this is what I did. 1) Make sure you have the new postgis installed and have run the lwgeom, spatial_ref.sql files in your new db 2) I used the new pg_dump util (from 8.0 to dump the old db) - I'm not sure what happens if you use the old one. Anyrate the general command was pg_dump -h myoldpgserver -n public -F t myolddb -f mydata.tar (you might need to change the above a bit if you are backing up from a non-local pc that does not have a trust relationship with your old server) 3) pg_restore --list mydata.tar > restoreitems.txt (this gives you a list of the items backuped up - which you can then edit to only restore the stuff you want) 4)Edit the restoreitems.txt - cutting out all references to postgis functions and any other stuff you don't want to restore 5) pg_restore --use-list=restoreitems.txt --dbname=mynewdb --username=postgres mydata.tar (here I was on the real server so had no need for the -h flag) -----Original Message----- From: Pritesh Shah [mailto:pritesh.krish@gmail.com] Sent: Wednesday, February 16, 2005 4:09 AM To: pgsql-general@postgresql.org; postgis-users@postgis.refractions.net Subject: [postgis-users] postgresql8.0 and postgis1.0.0 hi, I'm trying to backup a server and restore it on a different machine with newer versions of postgresql and postgis. Dumps have been created for the following versions from the old database server: Postgresql 7.4.6 Postgis 0.8.2 Now since both the packages have released newer versions i've installed the following on my newer machine where i would like to restore the dumped databases. Postgresql 8.0.1 and Postgis 1.0.0 For restoring the information i'm using psql -e -f abc.sql template1 While restoring the dumps i've collected the following information where the problem occurs: .. .. .. CREATE FUNCTION histogram2d_in(cstring) RETURNS histogram2d AS '$libdir/libpostgis.so.0.8', 'histogram2d_in' LANGUAGE c STRICT; psql:abc.sql:3947: ERROR: could not access file "$libdir/libpostgis.so.0.8": No such file or directory .. .. .. I understand that this is due to the following: libpostgis.so.8.0 is now liblwgeom.so.1.0 and also histogram2d_in is now lwhistogram2d_in histogram2d_out is now lwhistogram2d_out and so on. Now my problem is there are a lot of databases that use the postgis stuff (like the histogram2d_in) which has changed from the older version to the newer version. What do i do to overcome this problem?? Can somebody help me out with this?? Cheers, Pritesh _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
pgsql-general by date: