Error importing a file to PostgreSQL -


i'm trying import tab separated values file postgresql database using "copy" command. problem is fails on line error message

error: invalid byte sequence encoding "utf8": 0x00 

the bad line can found in this file.

it still fails when try import single-line file.

i tried open file looks normal text file , cannot find anyway resolve problem. schema of table looks like

create table osm_nodes (   id bigint,   longitude double precision,   latitude double precision,   tags text ); 

i use following command copy file

cat bad_lines2 | psql -c "copy osm_nodes stdin delimiter ' '"

(note: delimeter above tab character)

i use (postgresql) 9.2.3.

thanks help.

i found error. text contains "\09" translated tab character , caused problem. each "\" should escaped "\" can inserted correctly.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -