postgresql - COPY command does not ignore sequence column -


i have database whereas first column labeled serial not null primary key. table creation , automatic sequence table creation successful. however, whenever do:

copy <table_name> '/path/to/file' delimiter ',' csv header;

postgresql tries read first column serial column, fails because first column in csv file contains characters (not integer).

how can tell copy command populate using serial column first column?

i determined if specified header names , named columns header names in csv file, import worked:

copy <table_name>(column1, column2, etc) '/path/to/file' delimiter ',' csv header; 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -