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.