From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wells Oliver <wellsoliver@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Trouble w/ COPY command
Date: Sat, 14 Apr 2012 20:01:02 -0400
Message-ID: <19492.1334448062@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOC+FBUmbk9RhTZTFTULBhKMGQcXfhVEqjEeqJ7PChgk3kdLRQ@mail.gmail.com>
References: <CAOC+FBUmbk9RhTZTFTULBhKMGQcXfhVEqjEeqJ7PChgk3kdLRQ@mail.gmail.com>
Wells Oliver <wellsoliver@gmail.com> 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
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, wellsoliver@gmail.com
Subject: Re: Trouble w/ COPY command
In-Reply-To: <19492.1334448062@sss.pgh.pa.us>
* 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