Problems importing data
am 20.08.2004 17:17:41 von DevinHey,
I am exporting data from one database and importing into another
database. I dump the data from one database like so:
pg_dump dbname -R -a -f exportFile.sql
I then import the data using:
psql import_db -f exportFile.sql 1>>import_sql 2>>import_errorlog
However, when I do the import my import_errorlog gets filled with these
errors:
This is the big one. It seems to happen thousands and thousands of
times!!
psql:exportFile.sql:196563: invalid command \N
I don't know why it keeps happening!
These two are similar and I think...correct me if I am wrong...is caused
because there is a \r or a \t in a data field (probably a text field)
and this is confusing psql. But how do I get around this?? Do a search
and replace on \r and \t?? There must be a better way?
psql:exportFile.sql:196563: \r: extra argument "(416)" ignored
psql:exportFile.sql:203889: \t: extra argument "TNSA:" ignored
This is part of a sample data line where the above error occurs:
\N please ask for Frank Junior fr confirmation \r\n\r (416)
743-7378 \N \N s
This is another one. I think it happens when a table has no info in it
but shouldn't psql be able to handle this??
psql:exportFile.sql:97720: invalid command \.
This is sample data for the above error.
COPY getnext (client) FROM stdin;
\.
One way around these errors *I guess*, is to export all the data as
inserts with column names...but this takes forever because I have a lot
of data. Any suggestions would be appreciated.
Later
--
Devin Whalen
Programmer
Synaptic Vision Inc
Phone-(416) 539-0801
Fax- (416) 539-8280
1179A King St. West
Toronto, Ontario
Suite 309 M6K 3C5
Home-(416) 653-3982
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org