dbTalk Databases Forums  

How to import data from ver 7.3.2 to 7.0.2 installation

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss How to import data from ver 7.3.2 to 7.0.2 installation in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simon Ashford
 
Posts: n/a

Default How to import data from ver 7.3.2 to 7.0.2 installation - 06-26-2003 , 03:30 PM






I'm not going to bore you with the what's, why's and where for's and I'm not
looking for the suggestion of upgrade the other server.

I have a server running Postgres 7.3.2 and need to transfer the whole
database (structure, data, etc but not permissions) to another server
running Postgres 7.0.2.

I have tried this command with pg_dump on the 7.3.2 install to make a backup
of the data an a plain text file:

pg_dump -f /home/postgres/grd01.sql -O -x grd01

Switches I have used should do:

-O Causes ownership to not be taken into account in the dump. A restore
with suppressed ownership will cause all re-created objects to belong to the
user performing the restore.

-x Supresses and GRANT or REVOKE statements, which are usually used to
preserve the rights set at the time of the dump. Use this flag if you do
not wish to enforce any existing rights or restrictions when re-creating a
database from this dump.

On the 7.0.2 server I have then created a user grd01 and used this user to
create database grd01. I then run this command using the file I have FTP'd
across:

psql -U grd01 -f /home/postgres/grd01.sql grd01

I get lot's of this sort of thing:

psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N

and that's it! Can I regress a database like this or are the commands
created on the newer version not compatable with the older server. Are
there any work arounds to this?

As further analysis if I try and import this database to another server
running 7.3.2 it works fine.

Thanks very much in advance, any assistance greatly appreciated.

--
Simon Ashford MCP
IT Consultant, Netlink Data Solutions Limited.




Reply With Quote
  #2  
Old   
Simon Ashford
 
Posts: n/a

Default Re: How to import data from ver 7.3.2 to 7.0.2 installation - 06-26-2003 , 03:32 PM






Sorry it's posted so many times haven't got a clue what happened there
although did take a while to post.

--
Simon Ashford MCP
IT Consultant, Netlink Data Solutions Limited.
"Simon Ashford" <simon (AT) netlinkdata (DOT) co.uk> wrote

Quote:
I'm not going to bore you with the what's, why's and where for's and I'm
not
looking for the suggestion of upgrade the other server.

I have a server running Postgres 7.3.2 and need to transfer the whole
database (structure, data, etc but not permissions) to another server
running Postgres 7.0.2.

I have tried this command with pg_dump on the 7.3.2 install to make a
backup
of the data an a plain text file:

pg_dump -f /home/postgres/grd01.sql -O -x grd01

Switches I have used should do:

-O Causes ownership to not be taken into account in the dump. A restore
with suppressed ownership will cause all re-created objects to belong to
the
user performing the restore.

-x Supresses and GRANT or REVOKE statements, which are usually used to
preserve the rights set at the time of the dump. Use this flag if you do
not wish to enforce any existing rights or restrictions when re-creating a
database from this dump.

On the 7.0.2 server I have then created a user grd01 and used this user to
create database grd01. I then run this command using the file I have
FTP'd
across:

psql -U grd01 -f /home/postgres/grd01.sql grd01

I get lot's of this sort of thing:

psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:68: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N
psql:/home/postgres/grd01.sql:69: invalid command \N

and that's it! Can I regress a database like this or are the commands
created on the newer version not compatable with the older server. Are
there any work arounds to this?

As further analysis if I try and import this database to another server
running 7.3.2 it works fine.

Thanks very much in advance, any assistance greatly appreciated.

--
Simon Ashford MCP
IT Consultant, Netlink Data Solutions Limited.






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.