[postgis-users] TR: postgis_restore.pl

Regina Obe lr at pcorp.us
Sun Jun 27 10:49:09 PDT 2021


I would say you probably don’t need it unless restoring from really old
system.

 

Are you restoring from a PostGIS 1.5 or PostGIS 2.0?

 

Even with those, it should be sufficient if your database was created with
scripts instead of extension to first

 

1) CREATE EXTENSION postgis;  

 

--if your old backup is not in public, you may need to specify the schema
like so replace SCHEMA postgis with SCHEMA
name_of_schema_you_installed_postgis_in

CREATE EXTENSION postgis SCHEMA postgis;

 

 

CREATE EXTENSION postgis_topology;

 

2) Use pg_restore to restore your backup (or psql if it’s a plain text
backup)

 

 

From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf
Of Alain Benard
Sent: Friday, June 25, 2021 2:20 AM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] TR: postgis_restore.pl

 

Hi ,

Because of problem with Postgres 12 / Postgis 2.5.5 on Centos 8  we test to
install Postgres 12 / Postgis 3.0.

In the pats i have used your script postgis_restore.pl and this script is
again present in the directory  /usr/pgsql-12/share/contrib/postgis-3.0/. In
this script i find :

# # Copyright (C) 2009 Paul Ramsey <pramsey at cleverelephant.ca
<mailto:pramsey at cleverelephant.ca> >

# Tested on:

#

#    pg-8.4.9/pgis-1.4.3    => pg-8.4.9/pgis-2.0.0SVN

#    pg-8.4.9/pgis-2.0.0SVN => pg-8.4.9/pgis-2.0.0SVN

#    pg-8.4.9/pgis-2.0.0SVN => pg-9.1.2/pgis-2.0.0SVN

#    pg-9.1b3/pgis-1.5.3    => pg-9.1.1/pgis-2.0.0SVN

On the server postgis 2.5.5 i dump with –Fc and on the new (Postgis3) i use
the script with some mistakes :

ERREUR:  la relation « geometry_columns » n'existe pas

LIGNE 1 : UPDATE topology.topology t set srid = g.srid FROM geometry_c...

                                                            ^

ERREUR:  la relation « spatial_ref_sys » n'existe pas

LIGNE 1 : UPDATE spatial_ref_sys o set auth_name = n.auth_name, auth_s...

                 ^

ERREUR:  la relation « spatial_ref_sys » n'existe pas

LIGNE 1 : INSERT INTO spatial_ref_sys SELECT * FROM _pgis_restore_spat...

                      ^

ERREUR:  la relation « spatial_ref_sys » n'existe pas

ERREUR:  la relation « spatial_ref_sys » n'existe pas

ERREUR:  la relation « spatial_ref_sys » n'existe pas 

It seems that the restore is ok but what is your opinion about using this
perl script today ??

Thank you for advance.

Alain.






 


Alain BENARD


Administrateur Systèmes d’Information


 <mailto:alain.benard at inra.fr> alain.benard at inra.fr


Unité SILVA


Tél. : +33 3 83 39 40 84

	


Route d’amance 


54 280 Champenoux


 <http://www.inra.fr> inra.fr

 




	

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210627/7df9f9c0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 187 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210627/7df9f9c0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 174 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210627/7df9f9c0/attachment-0001.png>


More information about the postgis-users mailing list