[postgis-users] problem with database upgrading

Jaakko Kahkonen jaakko.kahkonen at fgi.fi
Wed Dec 17 07:25:49 PST 2003


Hello,

I would like to export database from old computer (RedHat Linux 7.2, 
postgresql-postgis-7.1.3-1PGDG) and import it to new computer (Gentoo 
Linux, postgresql-7.3.4, postgis-0.7.5). I'm trying to do it with 
upgrading instructions at 
http://postgis.refractions.net/docs/x83.html#AEN150 :

   # pg_dump -t "*" -f dumpfile.sql yourdatabase
   # dropdb yourdatabase
   # createdb yourdatabase
   # createlang plpgsql yourdatabse
   # psql -f postgis.sql -d yourdatabase
   # psql -f dumpfile.sql -d yourdatabase (problem with this!!)
   # vacuumdb -z yourdatabase

When reading to the database, I get following:

bash-2.05b$ psql -f data_dump.sql -d testdata
You are now connected as new user jaska.
psql:data_dump.sql:17: NOTICE:  CREATE TABLE / PRIMARY KEY will create 
implicit index 'spa
al_ref_sys_pkey' for table 'spatial_ref_sys'
psql:data_dump.sql:17: ERROR:  Relation 'spatial_ref_sys' already exists
psql:data_dump.sql:34: NOTICE:  CREATE TABLE / PRIMARY KEY will create 
implicit index 'gc_
' for table 'geometry_columns'
psql:data_dump.sql:34: ERROR:  Relation 'geometry_columns' already exists
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
You are now connected as new user jaska.
CREATE TABLE
You are now connected as new user jaska.
psql:data_dump.sql:399: ERROR:  copy: line 1, Missing data for column 
"attrelid"
psql:data_dump.sql:399: lost synchronization with server, resetting 
connection
You are now connected as new user jaska.
bash-2.05b$

Is there an easy and correct way to do this? I have original data as 
shapefiles, so I can always use them. We have deleted a few lines from 
database, so I decided to try without shapes at first.

--
Jaakko




More information about the postgis-users mailing list