From: Devin Whalen <devin@synapticvision.com>
To: pgsql-sql@postgresql.org
Subject: Problems importing data
Date: Fri, 20 Aug 2004 11:17:41 -0400
Message-ID: <1093015060.2335.22.camel@192.168.1.80> (raw)
Hey,
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: devin@synapticvision.com
Subject: Re: Problems importing data
In-Reply-To: <1093015060.2335.22.camel@192.168.1.80>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox