errors using COPY from MySQL data
errors using COPY from MySQL data
От:
Doug Silver <dsilver@urchin.com>
Дата:
I'm sure this has been covered before, but I'm quickly getting frustrated copying 100 lines at a time. I did a data dump from a MySQL table, one of the fields is a timestamp which it output as '20020816:23:44', so I changed it to '20020816 23:44'. But, I'm now consistently getting this error: data=# copy data from '/tmp/data.1'; COPY (I copy/paste 100 lines in from the original file) data=# copy data from '/tmp/data.1'; ERROR: copy: line 15, Bad timestamp external representation '' (copy/paste the first 20 lines from the original, i.e. the same data just the first 20 instead of all 100) data=# copy data from '/tmp/data.1'; COPY At first I was able to do 1000 lines at a time, but now it's down to 100 -- ok that's not very scientific, but it doesn't matter if I delete line 15 (which *looks* okay). Note the second time it didn't complain at all about line 15. Considering I have ~20000 entries, I'm going to need a lot of Snickers ... ;) PostgreSQL 7.3.2 TIA -doug
Re: errors using COPY from MySQL data
От:
Josh Berkus <josh@agliodbs.com>
Дата:
Doug, > I'm sure this has been covered before, but I'm quickly getting frustrated > copying 100 lines at a time. I did a data dump from a MySQL table, one of > the fields is a timestamp which it output as '20020816:23:44', so I changed > it to '20020816 23:44'. But, I'm now consistently getting this error: Hey, we can't help it if mysqldump's data formatting sucks. :-( Fortunately, there is hope: http://docman.sourceforge.net/home_html/projects/sql/mysql2pgsql Also see Techdocs (http://techdocs.postgresql.org) for additional MySQL-to-Postgres help & tips. -- -Josh Berkus Aglio Database Solutions San Francisco