X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 17A9A5E46D8 for ; Fri, 20 Aug 2004 12:20:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55657-06 for ; Fri, 20 Aug 2004 15:20:32 +0000 (GMT) Received: from 192.168.1.80 (unknown [66.207.200.34]) by svr1.postgresql.org (Postfix) with ESMTP id 4A44D5E4249 for ; Fri, 20 Aug 2004 12:20:17 -0300 (ADT) Received: by 192.168.1.80 (Postfix, from userid 500) id 0CE186A18A; Fri, 20 Aug 2004 11:17:41 -0400 (EDT) Subject: Problems importing data From: Devin Whalen Reply-To: devin@synapticvision.com To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Synaptic Vision Message-Id: <1093015060.2335.22.camel@192.168.1.80> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-2mdk Date: Fri, 20 Aug 2004 11:17:41 -0400 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/226 X-Sequence-Number: 18723 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