[postgis-users] Problems installing on Linux

James David Smith james.david.smith at gmail.com
Mon Aug 12 04:32:38 PDT 2013


Just thought I'd respond to say I've finally got this working. Thank
you to all of your for your help. It turned out that running the below
command before trying to use pg_restore sorted my problem:

psql -d [yourdatabase] -f legacy.sql

So in summary I have just upgraded PostgresSQL 9.0 with PostGIS 1.5
----> PostgreSQL 9.0 with PostGIS 2.0.  I followed the instructions
here:

http://postgis.net/docs/manual-dev/postgis_installation.html#hard_upgrade

Along with these:

http://postgis.net/docs/manual-dev/postgis_installation.html#create_new_db

Thanks again,

James




On 8 August 2013 17:53, Wilkins, Brian <bwilkins at harris.com> wrote:
> Hmm, sorry you are having such a hard time. You could try pg_dump -Ft which will do it in a tar format, but -Fc is the most flexible format and I wrote detailed notes on the upgrade that I tested on two other systems here, so the procedures are sound. I am not sure why you are having issues there... I don't know why I said to do -d because you are right, it's not a valid option.
>
>
> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of James David Smith
> Sent: Thursday, August 08, 2013 12:43 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Problems installing on Linux
>
> On 8 August 2013 17:27, Wilkins, Brian <bwilkins at harris.com> 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: postgis-users-bounces at lists.osgeo.org
>> [mailto:postgis-users-bounces at lists.osgeo.org] 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 <bwilkins at harris.com> 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: postgis-users-bounces at lists.osgeo.org
>>> [mailto:postgis-users-bounces at lists.osgeo.org] 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 <bwilkins at harris.com> 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: postgis-users-bounces at lists.osgeo.org
>>>> [mailto:postgis-users-bounces at lists.osgeo.org] 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 <james.david.smith at gmail.com> wrote:
>>>>> On 8 August 2013 15:57, Wilkins, Brian <bwilkins at harris.com> 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
>>>> postgis-users at lists.osgeo.org
>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>>
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at lists.osgeo.org
>>>> 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
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> 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
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> 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
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list