Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 90EEB13F0F81 for ; Sat, 14 Apr 2012 21:01:18 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SJCu4-0002QY-85 for pgsql-admin@postgresql.org; Sun, 15 Apr 2012 00:01:17 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q3F013YJ019493; Sat, 14 Apr 2012 20:01:03 -0400 (EDT) To: Wells Oliver cc: pgsql-admin@postgresql.org Subject: Re: Trouble w/ COPY command In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Sat, 14 Apr 2012 15:45:47 -0700" Date: Sat, 14 Apr 2012 20:01:02 -0400 Message-ID: <19492.1334448062@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/73 X-Sequence-Number: 39409 Wells Oliver writes: > I have CSV files blowing up because they have double quotes around numeric > values: " 1.34" yields ERROR: invalid input syntax for type numeric: " > 1.34" Is that an exact copy of the error message? Because there are double quotes in that error message's text; what you are showing does not suggest that they are part of the data value. I'm wondering about non-visible characters myself. > And occasionally these are empty, and you see invalid syntax for type > numeric: " " Well, that you're going to have to do something else about. Possibly you could treat the empty string as null? (See the 'null string' option to COPY.) regards, tom lane