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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -