On 8 August 2013 17:27, Wilkins, Brian <[email protected]> wrote: > I don't know how you created your dump, but this is how I created my dump > about a month ago and got it to work: > > First, > > $ pg_dumpall -h localhost -p 5432 -U postgres -globals-only > globals.sql > > $ pg_dump -d -Fc <database-name> > /tmp/<dump name>.dmp > > I always dump the globals just in case... > > Brian > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of James David Smith > Sent: Thursday, August 08, 2013 12:23 PM > To: PostGIS Users Discussion > Subject: Re: [postgis-users] Problems installing on Linux > > On 8 August 2013 16:43, Wilkins, Brian <[email protected]> wrote: >> postgis.sql.lst is the manifest file used to read in the sql functions, >> tables, etc. It is the original SQL plus .lst concatenated onto the filename. >> >> Make sure /usr/pgsql-9.0/share/contrib/postgis-2.0/ has permissions >> set to 755. For example, chmod 755 >> /usr/pgsql-9.0/share/contrib/postgis-2.0/ >> >> Or you can copy the script to like /tmp along with your sql and make sure >> your user can write to /tmp. >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of James >> David Smith >> Sent: Thursday, August 08, 2013 11:31 AM >> To: PostGIS Users Discussion >> Subject: Re: [postgis-users] Problems installing on Linux >> >> On 8 August 2013 16:13, Wilkins, Brian <[email protected]> wrote: >>> See here: >>> http://stackoverflow.com/questions/2517106/why-do-i-get-use-command-n >>> o >>> t-found-when-i-run-my-perl-script >>> >>> Could be your shell. >>> >>> -----Original Message----- >>> From: [email protected] >>> [mailto:[email protected]] On Behalf Of James >>> David Smith >>> Sent: Thursday, August 08, 2013 11:04 AM >>> To: PostGIS Users Discussion >>> Subject: Re: [postgis-users] Problems installing on Linux >>> >>> On 8 August 2013 16:02, James David Smith <[email protected]> >>> wrote: >>>> On 8 August 2013 15:57, Wilkins, Brian <[email protected]> wrote: >>> [snip] >>>> James >>> >>> Also if I run " perl -v " then I get: >>> >>> " This is perl, v5.8.8 built for x86_64-linux-thread-multi " >>> _______________________________________________ >>> postgis-users mailing list >>> [email protected] >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >>> >>> _______________________________________________ >>> postgis-users mailing list >>> [email protected] >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> >> Great stuff Brian. I've no idea how you knew that. But putting 'perl' >> at the start seems to get it started. Though another problem unfortunately! >> >> ------------WHEN I RUN THE SCRIPT-------- perl >> /usr/pgsql-9.0/share/contrib/postgis-2.0/postgis_restore.pl >> /usr/pgsql-9.0/share/contrib/postgis-2.0/postgis.sql >> james_traffic_restored james_traffic_05082013.sql > restore.log >> >> ---------THIS IS WHAT I GET ---------------- Converting >> /usr/pgsql-9.0/share/contrib/postgis-2.0/postgis.sql to ASCII on stdout... >> Reading list of functions to ignore... >> Writing manifest of things to read from dump file... >> : Cannot open manifest file >> '/usr/pgsql-9.0/share/contrib/postgis-2.0/postgis.sql.lst' >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > I've made a tmp folder in my home directory. > > /home/james/temp > > It now has the following in it: > > postgis_upgrade_20_minor.sql > topology.sql > legacy_gist.sql > raster_comments.sql > topology_upgrade_20_minor.sql > legacy_minimal.sql > restore.log > uninstall_legacy.sql > legacy.sql > rtpostgis_legacy.sql > uninstall_postgis.sql > postgis_comments.sql > rtpostgis.sql > uninstall_rtpostgis.sql > postgis_restore.pl > rtpostgis_upgrade_20_minor.sql > uninstall_topology.sql > postgis.sql > spatial_ref_sys.sql > postgis.sql.lst > topology_comments.sql > > I run the following: > > perl temp/postgis-2.0/postgis_restore.pl temp/postgis-2.0/postgis.sql > james_traffic_restored traffic_backup_08082013.sql > restore.log > > But still get error: > > Converting postgis.sql to ASCII on stdout... > Reading list of functions to ignore... > Writing manifest of things to read from dump file... > pg_restore: [archiver] input file does not appear to be a valid archive > postgis_restore.pl: pg_restore returned an error > > It sounds like it doesn't like the file type. So I did a new dump like so: > > pg_dump --verbose -F t --file traffic_backup_08082013_v3.sql > james_traffic_backup > > I thought that this would make a TAR file which is what it seems to want. So > I now do pg_restore again: > > perl temp/postgis-2.0/postgis_restore.pl temp/postgis-2.0/postgis.sql > james_traffic_restored traffic_backup_08082013_v3.sql > restore.log > > However I still get the same error: > > Converting postgis.sql to ASCII on stdout... > Reading list of functions to ignore... > Writing manifest of things to read from dump file... > pg_restore: [archiver] input file does not appear to be a valid archive > postgis_restore.pl: pg_restore returned an error > > Aaaargh. What an earth file format does it want it to be? Or maybe this error > is misleading? > > Thanks > > James > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Did you mean to put '-d' in that dump command Brian? It says invalid and isn't on the command list? I removed it and did: pg_dumpall -U james --globals-only > globals.sql pg_dump -Fc james_traffic_backup > temp/postgis-2.0/traffic_dump.dmp It creates the files ok. Then: Converting temp/postgis-2.0/postgis.sql to ASCII on stdout... Reading list of functions to ignore... Writing manifest of things to read from dump file... pg_restore: [archiver] input file does not appear to be a valid archive temp/postgis-2.0/postgis_restore.pl: pg_restore returned an error Weird. I've been googling this too obviously and a few people have had the same issue. They tend to resolve it by dumping as a tar or similar, but I think I'm doing that. I've certainly tried too. Can't thank you enough for your help. James _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
